Having a balanced diet is good for the mind. So, I try to eat foods that contain omega-3 (salmon, walnuts), complex carbohydrates (whole grains), vitamin D (green vegetables) to stay alert mentally. 

I don't consume excessive amounts of sweet foods and other foods that have been through processing. Additionally, it's important to drink water and avoid caffeine loaded drinks.