Why You Can't Sleep Before a Test (And What Actually Helps)
I remember sitting in my dorm at 3 AM, staring at the ceiling, knowing I had an organic chemistry midterm at 8 AM. Every time I closed my eyes, my brain decided it was the perfect time to review reaction mechanisms. This isn't unique to me. It's one of the most common problems students face, and the standard advice — just relax, don't worry — doesn't work because you literally cannot will your nervous system into shutting down. The biology here is straightforward but brutal. Your body has a stress response called the HPA axis activation — that's hypothalamic-pituitary-adrenal. When you're anxious about performance, cortisol spikes. Cortisol suppresses melatonin. No melatonin means no sleep onset. You're fighting chemistry at this point, not psychology. Breathing exercises help a little, but they're fighting a hormonal wave, not a thought pattern.
What to Do When You're Cant Sleep Night Before Exam
Here's what actually works from personal experience. I've run through this protocol myself during finals weeks and for friends who were falling apart: Get out of bed after twenty minutes. If you've been lying there for twenty minutes and haven't dropped off, get up. Your bed has now become associated with frustration. That's classical conditioning, and it works against you. Go to another room, keep the lights dim, and do something boring. Read a textbook — preferably something unrelated to what you're being tested on. Do some light stretches. The goal is to let the anxiety settle naturally, not to force sleep. Cold exposure. This sounds ridiculous until you try it. An ice pack on your wrists or the back of your neck triggers the mammalian dive reflex, which slows your heart rate through the vagus nerve. I did this during my chemistry finals week and it dropped my resting heart rate from about 105 down to 78 in roughly five minutes. That's not placebo — that's autonomic nervous system hijacking. You can also splash cold water on your face or hold an ice cube in your hand. The intensity matters more than the duration.
Balanced carbohydrates, not protein. This is the counter-intuitive part most people miss. You might think protein before bed helps because of tryptophan, but the real mechanism involves insulin. A small amount of carbs — like a few crackers or a small piece of fruit — triggers insulin release, which clears competing amino acids from your bloodstream and allows tryptophan to cross the blood-brain barrier more efficiently. I learned this the hard way after eating a chicken sandwich at midnight before a physics exam and staying awake for another four hours. Switch to crackers with a little cheese. Not a full meal. Just enough to trigger the mechanism without triggering digestion that keeps you alert. Binary search your sleep window. If you have until 8 AM and it's 2 AM, don't aim for a full eight hours. That's impossible and will make you more anxious. Aim for ninety minutes — one complete sleep cycle. Set an alarm for 3:30 or 4 AM. The goal is one solid cycle, not restorative sleep. Even one cycle reduces adenosine buildup and gives you marginally better cognitive function than zero sleep. I've pulled these off before, and the difference between ninety minutes and nothing is measurable on cognitive tests, even if you still feel like garbage. NSDR or yoga nidra. Non-sleep deep rest is a twelve to twenty-minute guided protocol that mimics some of the restorative effects of actual sleep. Studies on this are still preliminary, but the subjective reports are consistent across thousands of people. It's not a replacement for sleep, but it's better than lying awake stressing about not sleeping. There are free tracks on YouTube or apps like Balance. I use it when I know I'm only going to get two or three hours anyway.
Get the Full Details

What Not to Do
Don't drink coffee to compensate. Caffeine has a half-life of about five to six hours. If you knock back a large coffee at 6 AM to make it through your 8 AM exam, you'll be at roughly 50% of that caffeine level at noon and still significant levels by dinner. It might help you get through the test, but it will absolutely wreck your sleep the following night, creating a compounding deficit. One espresso at most, and only if you have the rest of the day to metabolize it. Don't pull an all-nighter to "study more." This is the most common mistake I see, and it's almost always counterproductive. Sleep is when memory consolidation happens — specifically during slow-wave sleep and REM. You're not preserving knowledge by staying awake; you're actively preventing your brain from filing what you just studied. Four hours of review before bed followed by six hours of sleep will outperform six hours of review followed by two hours of sleep on virtually any standardized measure of recall and problem-solving. Don't take over-the-counter sleep aids unless you've used them before and know how you react. Something like diphenhydramine (Benadryl) causes grogginess and can impair cognitive function for hours after you wake. If you're going to use something, melatonin at 0.5 to 1 milligram is the least disruptive option. Anything higher tends to cause next-day fatigue. And again, don't try a new supplement the night before an exam. You want predictability, not experimentation.
The Realistic Expectation
Here's what nobody tells you: sometimes you're going to lay there and get nothing. Your body is wired for threat detection right now, and no amount of technique will override it every single time. If you wake up and you genuinely haven't slept at all, the priority shifts. Accept it. Do the NSDR thing anyway. Hydrate. Get some sunlight within thirty minutes of waking — even if it's cloudy — because light hitting your retina suppresses melatonin and starts resetting your circadian clock for the next night. Don't nap. A twenty-minute nap might seem helpful but it'll fragment your sleep pressure and make tonight worse. The exam itself is usually survivable on minimal sleep. Your brain has residual cognitive function even after severe sleep restriction. The danger is the second night — the test after the one you couldn't sleep through. That's when the compounding deficits really show up. Plan accordingly. If this happens more than once or twice in a semester, it's worth talking to a counselor or doctor. Chronic exam anxiety is treatable, and beta-blockers like propranolol are sometimes prescribed for performance situations. That's a medical decision, but it's something to be aware of if you're in that position regularly.