Here are six rules to follow, and how to prevent overdoing it, which can cancel out the weight-loss benefits of breaking a sweat.

Eat within 30 to 60 minutes after exercise.
If you’ve had a particularly tough workout, try to eat a “recovery” meal as soon as possible. Exercise puts stress on your muscles, joints, and bones, and your body “uses up” nutrients during workouts; so post-exercise foods are all about putting back what you’ve lost, and providing the raw materials needed for repair and healing. In fact, it’s the recovery from exercise that really allows you to see results in terms of building strength, endurance, and lean muscle tissue. Not recovering properly can leave you weaker as you go into your next workout, and up your injury risk.

Think beyond protein.
Protein is a building block of muscle, so it is important post exercise, but an ideal recovery meal should also include good fat (also needed for healing muscles and joints), as well as plenty of nutrient-rich produce, and a healthy source of starch such as quinoa, sweet potato, or beans. These foods replenish nutrients that have been depleted, and provide energy to fuel your post-exercise metabolism. A great post-workout meal might be something like a smoothie made with either pea protein powder or grass-fed organic whey protein, whipped with fruit, leafy greens, almond butter or coconut oil, and oats or quinoa, or an omelet made with one whole organic egg and three whites, paired with veggies, avocado and black beans.

Keep it real.
The phrase “you are what you eat” couldn’t be more true. Nutrients from the foods you eat food are the foundation of the structure, function, and integrity of every one of your cells. Your body is continuously repairing, healing, and rebuilding itself, and how healthy your new cells are is directly determined by how well you’ve been eating. In short, your body is essentially one big miraculous construction site that’s open 24/7. So even if you’re lean and you burn a lot of calories, avoiding highly processed food and eating a clean, nutrient rich, whole foods diet can help you get the most out of all of your hard work, including cells that function better, and are less susceptible to premature aging, injury and disease.

Don’t overcompensate.
If weight loss is one of your goals, it’s important to not overestimate how much extra food you “earned” working out. In fact, it’s incredibly easy to “eat back” all of what you’ve burned. For example, in a one-hour elliptical session, an average woman burns about 490 calories. A large salted caramel Pinkberry contains 444 calories, and a 32 ounce high-protein pineapple smoothie from Smoothie King clocks in at 500 calories. Even if you don’t splurge on treats like these, you may be tempted to sneak a little extra almond butter, or be less mindful of your oatmeal or fruit portions, and those extras can add up. And if you’re going to be eating a meal within an hour of finishing up a workout, you don’t also need a post-exercise bar or snack.

Rehydrate.
If you sweat heavily, exercise in high humidity (which prevents cooling of the body) or your workouts last longer than 60 minutes, you might need a sports drink rather than plain water during exercise. These beverages are designed to keep you well hydrated, but they also provide electrolytes to replace those lost in your sweat (like sodium, which makes sweat salty; and potassium, which helps regulate heart rhythm), as well as fuel to keep you going. If your workouts are less strenuous, shorter, climate controlled, or not so sweaty, plain H2O is probably fine. The general rule of thumb is to drink at least two cups of fluid two hours before exercise, another two cups 15 minutes prior, and a half-cup every 15 minutes during. Post exercise, aim for two cups of water (16 ounces) for every pound of body weight lost, and monitor the color of your urine — if you’re well hydrated it should be pale.

Watch your alcohol intake.
Many athletes and active people I work with enjoy imbibing a bit after working out. Alcohol in moderation is fine, but be sure to eat first to start the recovery process. Also, it’s important to know that alcohol has been shown to accelerate post-exercise muscle loss and the loss of muscle strength by as much as 40%. It can also interfere with replenishing glycogen, the storage form of carbohydrates you stock away in your muscles to serve as energy “piggy banks.” Less glycogen can translate into a lack of power or endurance during your next workout, so aim for moderation.