Don't eat during the one hour before you work out. You might get indigestion.
Up to an hour before, eat "energy food" like a banana, or pasta. Go for slow release energy. Avoid "buzz energy" thing like chocolate.
After the gym, you need to help your body repair and stressed or damaged tissue, so you need "building block" food ... protein, like chicken, or meat, nuts, milk, etc.
If you use the gym in the evening, avoid eating carbs afterwards. Your body won't use them, and you will just store them. ie you will put on weight.