Good luck indeed.

It’s 4 a.m: you’re staring down at the textbook, and words are blurring together. Suddenly your head is down on your book, using the pages as a pillow. It’s not always a test, though. Sometimes it’s a paper you didn’t bother starting, either purposefully or accidentally-on-purpose. Whatever the case, both scenarios call for an all-nighter. Swallowing gallons of coffee or energy drinks isn’t good for your health, though, and there are actually ways to stay awake all night without resorting to caffeine.

If you’re planning on pulling an all-nighter, don’t eat a huge dinner filled with carbs (like pizza or a burger and fries) because those will just make you even more tired as the night goes on. Eat protein, like meat or fish, along with vegetables. Steer clear of junk food, though feel free to nibble on fruit or nuts. Apples are really good to eat when you’re tired because the fructose provides energy without a crash and chewing keeps you awake. Ice chips also work if you want to chew and the coldness will wake you up, or you could even chew gum just to keep your jaw moving. Also, drink cold water throughout the whole night. Not only will the coldness snap you awake, it may also make you need to use the bathroom, which will force you to get up and walk to the toilet.

As you’re studying or writing a paper, make sure to get up at least every hour and walk around. Do something else for 10 minutes, whether it be watching a video online, checking Facebook to see if anyone else is awake, or simply walking in circles around your room. Making yourself move will help give you another boost of energy to work through the next 50 minutes or so until you get up again. You could even read standing up. If you get too comfortable, you will probably fall asleep.

If moving around isn’t working, combine it with something else. Go to the bathroom and wash your face with freezing cold water. If you have enough time, take a cold shower (that will definitely wake you up!). A good time to take the shower would be before going to your class to make sure you’re wide awake for when you actually write the exam. When you feel completely desperate and nothing else is working, take a fast nap. Make sure to set a loud alarm or get someone to wake you up after fifteen or twenty minutes. If you don’t want to risk sleeping, try lying on your back on the floor and put your feet up on a chair for about 10 minutes (once again, set an alarm just in case!) and focus on your breathing. This form of relaxation makes all the difference when you just need to keep going for a couple more hours.

Staying up all night with a friend can be useful because you can keep each other awake—as long as you actually study. In the worst-case scenario, you could have something with sugar, like chocolate or candy, to give you a boost. But the danger with that is there will be a crash within a couple hours, so only do that at the very end of your night. The best thing would be to sleep for a couple hours before your class to let the information you’ve been studying get stuck in your brain

So if you’re worried about that caffeine fix come finals, try a few of these tips and give your body a break. Or try and make sure you start studying ahead of time so you don’t have to resort to staying up all night! Either way, good luck!