I'd had the same problem since I was a kid. It's often so bad that it prevents me from using even half my brain. Makes me lazy and unmotivated to do anything. What helps is regular 'human' sleep hours (like 10pm-7am) and doing some serious excercise. Eat regularly but not too much that you feel stuffed. Don't drink coffee but instead lots of water and some orange juice. No snacking but if you must, snack on fruits.