For my referential use only. These will not work for anyone else but me. I'm only putting this here so I won't forget.
Get enough sleep
This one is obvious. But don't think that you should start sleeping 8 hours, I think this is a lie. The minimum required hours of sleep varies among people. Some can get by with 6 to 7 hours of sleep. Just sleep enough that when you get up you don't feel groggy or irritated. Experiment.
Don't over eat
Unless you're eating plants. Over eating during meals (especially with meat) will surely leave you in a comatose. I think this is why children feel so active even after lunch, because unlike their parents who are used to eating a lot more because of rules ingrained in their brains (no leftovers, eat everything in your plate), children only eat what they want (sometimes they don't even want to eat full meals).
Cut back on the caffeine
Ironic. The elixir that helps you get through the day will also kill you. You see, drinking anything with caffeine doesn't give you additional energy, it just helps you release more of the stored energy in your body. So if you've been drinking lots of coffee but not getting enough rest, it won't be effective and you're just tiring yourself more. Drink your caffeine only when you need it the most.
Nap
This one is hard. But if ever you do get the chance to get a 15 minute shut eye, go and take it. I know you can just power through the moments of drowsiness with willpower or red bull, but nothing beats waking up all refreshed and recharged.
Switch Task
Maybe you're not up to doing the task at hand. Work on a smaller task, so as not to break your flow. Be sure to have good notes of the tasks you're supposed to be doing, so you won't end up checking facebook.
Take a walk
Get outside. If there's a body of water nearby, go and sit nearby. It's good to have a change of space once in a while to get you back into perspective.