Runners watching the 2016 marathon trials would be the first to tell you that the finish of the women’s race was a nail-biter. Amy Hastings Cragg and Desiree Linden looked strong in those final miles, while the incredibly fit Shalane Flanagan started to fall off her impressive pace. 

The heat in L.A. forced a look to creep across Flanagan’s face that many of us unfortunately can relate to. The “my-wheels-are-about-to-fall-off” look that follows glycogen depletion and dehydration. But in Flanagan’s case, the world couldn’t see the What Is a Shoey. She collapsed into a third-place finish, clinching a spot on the U.S. marathon team and earning a trip to the medical tent for IV rehydration. 

The 10,000 meter American record holder will consult with top experts to establish a personalized hydration and fueling strategy that will power her through Rio’s heat at this summer’s Olympic Games.  

But for us mere mortals, who don’t have access to the guidance of the U.S. Olympic Committee, follow these science-based tips to help prevent debilitating dehydration from derailing training runs and races.

Why Hydration is Important

When your muscles work, they create heat. Sweat works to dissipate this heat, but if you’re not replacing those fluids with water and sports drinks (which have electrolytes that help balance your body’s fluids), and conditions are hot, it creates the perfect storm: your heart is forced to work harder, your glycogen stores run out more quickly (you hit the Wall sooner), your cognition is altered (that voice saying “you can’t do this” gets louder), and your body heat rises, increasing the risk of heat stroke. 

It doesn’t take much fluid loss to compromise cognition and exercise performance; most experts agree that losses of more than 2 percent body weight, particularly in hot weather, can make goals harder to achieve (not to mention pose a threat to your health). When it’s cooler out, the negative effects of dehydration take a bit longer to occur—around 3 to 5 percent loss of body weight. To stay one step ahead of the dangerous effects of dehydration, it’s important to start your race or run hydrated, drink during your workout, and rehydrate post workout. 

Before Your Run

Start exercise properly hydrated by drinking about one ounce per 10 pounds of body weight two to four hours before you head out—your urine should be a pale yellow. For example, if you weigh 150 pounds, drink approximately 15 ounces of fluids a few hours before starting your run. If you run first thing in the morning, it’s crucial to hydrate before going to bed the night before. If you know conditions for your run or race will be hot, it can help to add a little sodium to your prerun meals and drinks (but make sure to try this during training so your body knows what’s up come race day). 

During Your Run

Runners’ hydration needs depend on many things, including how much they sweat. And believe it or not, overhydrating can be more dangerous than not hydrating enough. 

While one athlete might lose as little as 10 ounces of sweat an hour, another might lose more than 60 ounces, which means a loss of more than four pounds from sweat. The best way to determine how much fluid you need to consume each hour of training is to complete a sweat test during a training run. 

It’s not as hard as it sounds. Weigh yourself before your run and immediately after to determine how much fluid was lost. Remember, one pound equals 16 fluid ounces. The goal is to replace sweat losses so you don’t lose more than 2 percent of your body weight. But overhydrating with can throw off the balance of your sodium, causing potentially fatal hyponatremia. 

If you find that you are a heavy and salty sweater (your face and clothes have salt marks), consume electrolytes or sports drink instead of, or in addition to, water. Like fluid losses, the range of sodium losses varies, but the average concentration of sodium in sweat is about 1 gram per liter. A sports drink close to this concentration—500 mg of sodium per 16-ounce serving—will help replace lost sodium.  

After Your Run

Unless your mouth feels like sandpaper and you can’t take another step without drinking water, rehydrating postrun may not be top of mind. But it should be. Rehydration not only replaces the fluid you’ve lost along the miles, but it also enables your body to recover and prepares you for your next workout. Drink non-alcoholic fluids freely until your urine returns to a pale yellow color, and don’t shy away from salty foods, as these foods can help you retain water—which in this case is actually a good thing.