The long-term practices are to get a good, healthy diet; sleep on a regular schedule, at least 7 hours a night (or day, if you work the graveyard shift); and exercise regularly to stay physically fit.
The short-term practices are more detailed. And we can all take a hint from truck drivers, who are experts in driving long distances and staying awake.
Underlying both the short-term and long-term practices is judicious use of caffeine. If you rely too much on caffeine, one study finds , you run the risk of crashing. For truckers who get a good, healthy amount of caffeine, another study found , they can avoid crashes and save lives.