The main fixes I’ve found for myself are:
- Get a lot of exercise and sunlight (if possible) to counteract the caffeine’s effect on sleep.
- Resist the urge to have more caffeine than usual when tired. It works well as an enhancer to a well-rested brain, but when used to compensate for sleep deprivation, it’s counter-productive.