Avoiding contaminated foods and water is the key to preventing foodborne illnesses. That said, if you do get sick, don't be hard on yourself—sometimes, even with the best precautions, contamination occurs.
To reduce the chance of ingesting contaminated food:8
Wash your hands for 20 seconds with soap and water before, during, and after preparing and cooking food and before eating.
Wash your knives, cutting boards, countertops, and other cooking utensils with soap and hot water.
Rinse fresh fruits, vegetables, and bagged greens.
Keep raw meat, eggs, seafood, and poultry away from other ready-to-serve foods or foods in the fridge.
Use separate cooking utensils/plates for raw meat, poultry, and seafood.
Avoid unpasteurized milk (raw milk) and juices.
Also, when cooking, use a food thermometer to make sure food is cooked to the appropriate temperature needed to kill germs (e.g., 165 degrees for all poultry).
In addition, throw out foods that are past their expiration date, even if they do not smell "bad" or look "funny." Many foods that are contaminated look and smell normal.
When traveling to other countries, do not drink tap water or use ice made from tap water, and try to avoid eating fruits and vegetables you can't cook or peel.
Another way to avoid food poisoning is to follow a predominantly plant-based diet, as many bacteria and parasites are more common in meat and animal products.