Caffeine more than six hours before bed

Caffeine can improve your mood and brain function, but beware: It takes five to six hours to clear your system. You’ll sleep best when you cut off caffeine consumption in the early afternoon.