This article originally appeared in Shape Magazine.

You know carbs are essential for energy and protein is vital for muscle growth, but certain foods are better than others for fueling up before and recharging your body after certain workouts. After all, you use different muscles and burn varying levels of calories depending on if you're lifting iron, pounding pavement, or doing plies. Find your planned exercise for the day and nosh on the recommended post- or pre-workout snack to keep your body at its best during class and long after.

Whatever exercise you're doing, eat a good pre-workout snack one to two hours beforehand to keep your stomach from growling and provide your body with pep without weighing you down. Then refuel within 30 to 45 minutes of your cool-down to provide the necessary nutrients to restore your hard-working muscles and rehydrate your body. (If you're working out first thing in the AM, you'll need these tips for what to eat before and after a morning workout.)