If you’ve endured an episode of “the runs” recently, you’re far from alone. American adults average one bout of acute diarrhea annually, while young children typically have two episodes each year, according to the National Institute of Diabetes and Digestive and Kidney Diseases. The condition, characterized by passing watery, loose stools three or more times daily, generally clears up in a couple of days. 

Food or water contaminated with bacteria such as salmonella or E. coli is a common cause of acute diarrhea. Viruses, including rotavirus, are another culprit and the most common trigger for acute diarrhea in kids. Reactions to food or medication, certain health conditions such as irritable bowel syndrome and infection with a parasite can also cause intense episodes of loose stools. 

Related: How Often Should You Wash Your Kitchen Towel?

Of course, when you’re running to the bathroom non-stop, all you want is relief. Here’s an expert guide on how to feel better fast.

What to drink and eat

The main treatment for most cases of diarrhea is focused on avoiding dehydration by replacing lost fluids and electrolytes. Electrolytes are crucial minerals that include sodium, potassium and magnesium. Adequate mineral levels are essential for our nerves, muscles, brain and heart to function properly.

It’s fine to drink water, but you’ll also want to sip liquids that add electrolytes. “We recommend water with some degree of added salt and sugar, so it could be a flavored soda or a broth,” says Mark Rood, MD, a Cleveland Clinic family medicine physician. 

Offer kids an oral rehydration solution such as Pedialyte or Naturalyte. Infants should be given breast milk or full-strength formula along with an oral rehydration solution. Since newborns and infants can become dehydrated quickly, notify your pediatrician right away if your baby “looks listless, has a dry tongue and a doughy appearance of the skin,” says Len Horovitz, MD, an internist at Lenox Hill Hospital in New York City. These are all signs of dehydration.

Jello, popsicles and weak black tea are all fine, too, says Horovitz.

Stick with belly-friendly bland foods that don’t irritate the stomach. These include plain pasta, baked potatoes, bananas, crackers and rice. Baked chicken without the skin and fat might also be tolerable.

What not to drink and eat

Avoid full-strength caffeinated tea, coffee and caffeinated sports drinks. Caffeine can make diarrhea worse, says Horovitz.

Steer clear of fried and deep-fried foods, as well as anything spicy, says Herbert DuPont, MD, director of the Center for Infectious Diseases at The University of Texas Health Science Center at Houston. “These can produce an irritation in the GI tract and this makes the diarrhea get worse,” he says. You also should avoid herbal teas and soy products, such as tofu, advises Horovitz, since both of these can have a laxative effect.

Related: Is Your Poop Trying to Tell You Something?

Hold off on the OTC medication

Consider waiting at least 48 hours after the diarrhea begins to take an over-the-counter anti-diarrheal medication such as Loperamide (Imodium), recommends Rood. “Your body has a natural desire to flush out whatever it is that is causing the diarrhea,” he explains. “We don’t want to stop that from happening.” Children and infants should not be given an OTC medication for diarrhea at all, unless your child's doctor advises it. “Kids are not miniature adults,” says Rood. “Rarely are medications necessary [for diarrhea], and OTC medications are not formulated for children and are not recommended.”

A probiotic supplement can help repopulate your gut with healthy bacteria. You can take one during and following a stomach bug, says Horovitz.

When to call the doc

If you have fever or bloody diarrhea, call your doctor, advises DuPont. Also call your doctor if your stool is black or bloody, if it contains pus, you have severe belly pain, you are 70 or older or you are dehydrated. Signs of dehydration include thirst, urinating less less frequently than usual, dry skin, dizziness, light-headedness and dark-colored urine.

Children should be seen by a health care provider if they appear dehydrated, have had diarrhea for more than 24 hours or have a fever of 102 degrees Fahrenheit or higher.

Related: 10 Health Symptoms Women Should Never Ignore

Rosemary Black, a mom of seven, writes often on food, health and parenting. She lives with her family in Pleasantville, NY.