Be choosy about what you eat. Raw food is most likely to be contaminated, particularly if you're in an area where hygiene and sanitation are poor. Avoid eating undercooked eggs, fish, and shellfish or meat. Cooked food should be served steaming hot and cooked all the way through.
If you're in a developing area, pass on salads, salsa, uncooked vegetables, and other cold items, since they may have been rinsed with contaminated water. Avoid un-pasteurized milk and milk products, such as soft cheeses and ice cream. Finally, don't buy food or drinks from street vendors, especially in developing countries. Adventurous eating is fun in the moment, but you may pay the price. Don't risk it.