Whether you’re dreaming of hiking the epic Colorado Trail, climbing a lung-busting Fourteener (or two), or preparing for an long-distance bike ride or run, here are some nutrition tips to help you reach (and exceed) your goals:

Eat a good breakfast. A few hours before the event, eat a mixture of carbs, some protein, and a little fat, says nutritionist and endurance runner Carol Haggans, who works as a consultant for the Office of Dietary Supplements at the National Institutes of Health. A bagel with peanut butter and honey, or oatmeal with dried fruit and nuts is ideal, along with orange juice and plenty of water, she says. Then, about 15 minutes prior to the start, down some last-minute carbs (like a banana) and drink more water, but not so much that you become bloated.

Keep consuming carbs. Haggans recommends eating 120 to 240 kilocalories (usually abbreviated as “calories” on food labels) of carbs each hour during the event. Great choices include dates, raisins, dried cranberries, mini pretzels, nuts, sunflower seeds, and even a few dark chocolate chips. Many people also like energy gels because they are easy to carry, swallow, and digest. If a race lasts more than four to six hours, you’ll want to eat some protein throughout as well, Haggans says.

Limit caffeine. Drinking small amounts of caffeine about an hour before the race may provide a performance boost, but be careful—you don’t want to overdo it, Haggans says. Aim for 3 to 6 milligrams per kilogram (2.2 lbs.) of body weight, or the equivalent of 2 to 3 cups of brewed coffee for a 150-pound person. Even if you limit yourself to one cup of coffee in the morning, it’s important to note that many of the energy gels and similar products also contain caffeine. Additionally, elite athletes who are in competition should check the regulations about caffeine and other performance enhancers well before the event.

(Before your race, read 7 training tips for endurance runners)

Alternate between water and a sports drink. Figuring out how much and what to drink is one of the most difficult tasks for endurance athletes to nail down. This is because it depends upon the weather and how much you’re sweating, says Haggans. For events lasting less than 90 minutes, plain water is fine to drink, but for anything longer, it’s important to mix in a beverage that replaces electrolytes, as well. Haggans usually alternates between water and a sports drink at aid stations, and she recommends checking ahead during preparations to make sure that both will be available.

Avoid experimenting the day before. The number one rule of endurance competitions, says Haggans, is to avoid eating anything new the day before or the morning of a big event, including food that’s really high in fiber or could cause gas, such as beans, broccoli, or onions. Haggans also recommends avoiding alcohol for at least several days before the event.

Pile on the protein. Endurance athletes should in general aim for 1.2 to 1.4 grams of high-quality protein per kilogram of body weight every day, especially during training. For a 150-pound person, that’s 82 to 95 grams, or the equivalent of 12 ounces of salmon or 2 cups of black beans, says Haggans. The rest of your calories should be divided between fruits, veggies, whole grains, low-fat dairy, and healthy fats (olive oil, fatty fish, nuts, avocado, etc.). And the same applies to vegetarians, who should up his or her intake of beans, nuts, whole grains, seeds, soy, dairy products, and eggs to get the required amount of protein pre-race.

Don’t count calories. The week prior to the event, Haggans recommends that athletes focus on eating enough to provide optimal energy. This isn’t the time to count calories; eat until you’re comfortably full, but don’t overdo it. Optimal nutrition and hydration are important to both prepare for and recover from training, and to increase your fitness level.

(Check out 7 training tips for long-distance cyclists)

Terri Cook
Terri Cook
Terri Cook is an award-winning freelance writer based in Boulder. More of her work can be found at down2earthscience.com.