Ideally you should get a meal in about three to four hours before your workout so that it has time to fully assimilate into your system. Try to include some complex carbs - such as brown rice, wholemeal bread or potatoes - and protein.
About an hour to an hour and a half before, you’ll be looking for about 40 to 50g of carbs and about 5g of protein which you can eat or make in a shake.
Drink plenty of water during your workout, looking to get about 250 ml every 15 minutes.
Afterwards, you’ll want about 0.5g of protein per kg of bodyweight and 1.5g of carbs per kg of bodyweight. If you take creatine (and you’re not loading), you can add about half a teaspoon to this concoction.
To give you an idea, I put some oats in a bowl and cover them with boiling water before I leave for the gym, then blend them with skimmed milk and a low fat yoghurt when I get back.
Something simple like a banana and a glass of milk will also do the job, depending on how much you weigh.
Within two hours of leaving the gym, get in a meal with plenty of complex carbs and moderate amounts of protein.