Well a simple answer is to exercise and then eat.
As I am sure you know though, nothing is quite that simple so let’s break it down a little more.
Pre-Workout: Within an hour before your workout I recommend having a light snack, preferably consisting of carbohydrates and protein. The carbs are going to be within your bloodstream and readily available for your body to burn when you start working out, you won’t feel quite as sluggish and able to get into your zone quicker. The protein is to fill you up.
The last thing you want is to workout while feeling hungry right? Protein releases hormones within the stomach that make you feel full and can help you get through your session without wanting to stop for cake during or afterwards. It is important to keep it small and light though, the last thing you want to do is have a full stomach only to throw it up during your workout! Also make sure you are drinking plenty of water.
Snack Ideas: Protein Bar, Mixed Nuts, Fruit, Peanut Butter
The most important thing your body needs during exercise is to stay hydrated; the best and most available (and cheapest!) solution of course is water. You can find water bottles for sale everywhere, invest in one and fill it up every time you have the chance. A great indicator of your hydration is your pee. You may have to pee more frequently; ideally you want to pee clear with a slight tint of yellow. If you do get hungry during your workout, relax and have a small serving of a pre-workout snack.
During your workout your body will be working hard and operating at a different level then at rest. Metabolically your body is burning both carbohydrates and fat for fuel, this is what keeps you going for longer, stronger and faster. After a while your body will start to deplete these different stores of fats and carbohydrates, in which case you’ll find yourself feeling exhausted, fatigued and even sore. After you cool down, your body is going to be very active in replenishing these stores of carbs and fat to be ready for the next time. The most crucial period is the first 30 minutes following the workout. This is called your “Anabolic Window” in which your body will rapidly absorb the calories to help replenish your body and aid in muscular regeneration. During this time it is really good to eat simple carbohydrates (such as fruits and starches) as the sugars are easy and quick for the body to absorb and give you more energy to make it to the car afterwards. It is also good to eat a source of fats as well (such as peanut butter, almond butter etc.). Fats are very high in calories (9 kcal per gram of fat) in which your body will quickly absorb and utilize as well.
I personally like to make a fruit smoothie that I add a lot of spinach to (lots of vitamins and minerals), frozen fruit, water, banana, kiwi and a serving of vanilla protein powder. It tastes really good and helps me recharge!
Like I emphasized during your workout, drink a lot of water, this will help encourage blood flow and hydration, make your body best efficient at absorbing nutrients as well as help keep your muscles from tightening up.
Finally after this 30 minute anabolic window has past, it is good to sit down and eat a full meal. Your meal should consist of complex carbohydrates (veggies) as well as nutrient dense foods (foods high in vitamins and minerals), protein (lean meat, fish, etc) and healthy fats (particularly polyunsaturated fats such as olive oil and fish.) to give your body a more full replenishment of overall nutrients including calories, vitamins, minerals and water.
When doing more research for these kind of questions and others related to exercise, fitness and nutrition you’ll find A LOT of conflicting information out there. My best advice would be to find what is the most consistent information and most importantly what works best for you.