Eating and exercise are connected. When and what you eat can affect on your workout. According to Dr. John M. Murphy, who practices family medicine in the Mayo Clinic Health System, you can maximize the effectiveness of your workouts by following a few tips:

1. Eat a healthful breakfast. If you exercise in the morning, get up early enough to finish breakfast at least one hour before your workout. This will give you energy and raise your blood sugar. If you don’t eat, you might feel sluggish or lightheaded when you exercise. Good breakfast options include whole-grain cereals or bread, bananas and yogurt. A cup of coffee is OK, too. Emphasize carbohydrates for maximum energy.

2. Be aware of portion sizes. You want to be careful not to overeat before exercise. Eat large meals at least three to four hours before exercising. Small meals should be eaten two to three hours before exercising. You can have small snacks an hour before exercising. Eating too much can leave you sluggish, and eating too little may not give you the energy to stay strong during your workout.

3. Snack well. Most people can eat small snacks right before and during exercise. It’s important to do what feels best for you. Snacks shortly before exercising probably won’t give you an energy boost, but they can help maintain blood sugar levels and prevent distracting hunger pains. Good snack options include energy bars, yogurt, low-fat granola bars and peanut butter sandwiches.

4. Eat after your workout. Eating after you exercise will help your muscles recover. If possible, eat within two hours. You’ll want a meal that contains protein and carbohydrates. Good post-workout food choices include yogurt and fruit, peanut butter sandwiches, pasta with meatballs and chicken with brown rice.

5. Drink up. Don’t skimp on water. You need adequate fluids before, during and after exercise to prevent dehydration. The American College of Sports Medicine recommends you drink 2 to 3 cups of water before your workout, ½ to 1 cup of water every 15 to 20 minutes during your workout and 2 to 3 cups after your workout for every pound of weight you lose during the workout.

“The duration and intensity of your workout will determine how often and what you should eat and drink,” said Murphy. “Pay attention to how you feel during your workout, as well as your overall performance. Let your body guide you on which eating habits work best for you.”