Ever wonder what to eat before a workout? Here's what the experts suggest.

Getting yourself to the gym can be a real struggle. We all crave the physical and mental health benefits that come from regular exercise, including reduced stress, increased muscle mass, improved mood, and feeling better about how we look. But sometimes willing oneself to go to the gym or even getting on the treadmill or picking up weights at home can feel like an uphill battle.

Experts have recommended all sorts of things to help such as exercising at a consistent time each day, exercising with a friend, monitoring and rewarding one's results, or adding a fun playlist to the workout. Another helpful strategy for both getting to the gym and for improving one's outcome once there is building and maintaining energy levels through proper nutrition.

How can food improve a workout?

Whether for a casual workout or for pumping iron for hours, food and drink plays a critical role in the quality of one's exercise. From avoiding the dangers of dehydration and electrolyte depletion to keeping energy levels high enough to evade that sluggish feeling that comes from having either eaten too much food or from eating any of the wrong foods.

Eating a lot of sugar before a workout, for instance, may give you a quick boost of energy, but it will be followed by a sudden drop in your blood sugar levels. Eating the right foods, on the other hand, will give you proper levels of strength and energy that will last through your workout and into your post-workout recovery. "Eating a variety of foods provides a variety of vitamins and minerals which helps your body work and perform its best," says Natalie Allen, MEd, RDN, a clinical associate professor and a team dietitian in the athletics department at Missouri State University.

What to eat before a workout

Before a workout, Allen recommends eating plenty of carbohydrates "to fill your body’s fuel tank." She says that if you’re grabbing a snack right before the workout, "then a concentrated carbohydrate food such as crackers or a piece of fruit are good choices." But if you're eating a meal a couple of hours beforehand, choose more complete options to maintain energy levels. "An athlete's plate should generally be divided into thirds: one third protein/meat, one third starchy carbohydrates such as rice, bread, corn, potatoes or pasta, and one third fruits and veggies," she says.

Beyond full meal options, Sue-Ellen Anderson-Haynes, RDN, a registered dietitian nutritionist and founder of 360 Girls & Women, says that some of her favorite quick-fix foods to eat before a workout include bananas, a mango or berry smoothie, or some crackers. "Combination foods like applesauce and pretzels, sliced beets and hummus or jam on toast are great as well," she adds. "Consuming these carbohydrates is one of the best ways to provide a burst of needed energy during your workout."

What foods to avoid before a workout

As important as it is to eat the right foods, avoiding the wrong ones matters, too. "We know following proven sports nutrition practices can improve your workout," says Allen. "On the flipside, poor nutrition can wreck a workout."

Foods to avoid include spicy or greasy foods that may trigger heartburn, plus anything that would fall into the "junk food" category such as soda, cookies, cake, fast food or candy. "Sugar will make you crash quick, leaving you feeling tired and devoid of motivation," says Caroline Susie, RD, a registered dietician and national spokesperson for the Academy of Nutrition and Dietetics.

Mayo Clinic notes that large meals should also be avoided if you're planning to eat within 1-3 hours of working out, though recommended portion size of course varies from person to person. "Listen to your body and do what is best for you," advises Allen.

Weightlifting or resistance training? Learn how to build strength and muscle mass

This article originally appeared on USA TODAY: What to eat before a workout