You can help to prevent diarrhea by practicing good hygiene. Most importantly, wash your hands frequently with soap and water, especially before eating, before preparing food, and after using the bathroom. Since some diarrhea is caused by food poisoning, avoid eating undercooked meats, raw seafood, or foods left out for several hours. If your episodes of diarrhea occur only rarely, a specific cause may not be found. If you experience recurrent episodes, try to identify the factors that trigger your symptoms, such as a reaction to medicine or certain foods, and avoid them.