It’s tempting to use a workout as an excuse to binge-eat afterward. Or to go to the opposite extreme and not eat at all to avoid sabotaging your exercise gains. Both are a mistake. Here’s a better strategy, courtesy of science.

Consider Your Timing

Many experts say it’s imperative to eat either immediately or up to two hours after exercise, but the research allows for more flexibility. In a review in the Journal of the International Society of Sports Nutrition (JISSN), researchers analyzed 85 studies and concluded that it depends on when and what you ate before the workout. In short, there shouldn’t be more than three or four hours separating your pre- and post-workout meals. Other factors to consider: the length and intensity of your workout (longer, harder workouts call for more replenishment) and how soon you plan on exercising again. If you plan to do another hard workout within eight hours, aim to eat within an hour or two. If not, as long as you get a reasonable amount of carbs and protein over the next 24 hours, your muscles should recover adequately.

Choose Your Fuel

The most common recommendation for post-workout fuel is to select a snack or meal with a 3:1 or 4:1 carb-to-protein ratio, but in reality, the research isn’t so black and white. The best approach depends on your type of workout and your goals. For example, if you do a resistance-training session and your goal is to build muscle, protein alone (especially whey protein) is adequate after your workout, according to a 2013 JISSN study. In general, longer or more intense cardio efforts require more carbohydrates to replenish stores of glycogen, which fuels your muscles.

Think Big Picture

Unless you’re a high-level athlete, a consistently healthy diet is more important than exactly what and when you eat before and after a workout. Instead of relying on specialized sports drinks or foods, which are often packed with added sugars, opt for fresh, whole foods at every meal and snack to keep your body happy before during and after every workout. When you are hungry after a workout, these food and beverage combos will provide the nourishment you need:

Recovery Smoothie

Blend together 3/4 cup coconut water + splash of lime juice + ½ cup yogurt + ½ peeled orange + 1/3 cup frozen strawberries + ½ frozen banana + 2 tablespoons whey protein (optional).

Recover Oatmeal

Combine 1 cup cooked oatmeal + 1 ounce walnuts + 1 tablespoon honey + ¼ cup blueberries.

Recovery Dinner

Prepare ¾ cup cooked brown rice + 4 ounces ground chicken + 4 large broccoli florets.