Skip to content
Sleep 15 min read Updated Jun 1, 2026

What to Do When You Can't Sleep: An Evidence-Based Guide

What to do when you can't sleep, tonight and long-term. Evidence-based fixes for sleep onset, mid-night waking, and the tired-but-wired state.

Haris Last reviewed
Person lying awake in dim bedroom looking at the ceiling at night

Medical Disclaimer: This content is for informational purposes only and is not a substitute for professional medical advice. Consult a qualified healthcare provider before starting any new fitness or supplement program.

In this article

What to do when you can’t sleep depends on what’s actually breaking. The fix for sleep onset insomnia (can’t fall asleep at the start of the night) is different from the fix for sleep maintenance insomnia (waking up at 3 AM unable to get back). And both are different from the chronic case that’s been running for months.

What follows splits the problem two ways. First, what to do tonight, in bed, when sleep isn’t coming. Second, the structural changes that prevent the same situation from happening again. Both matter. The immediate fixes get you through tonight; the structural ones change tomorrow night.

Why You Can’t Sleep

Sleep is not on or off. It’s the product of two systems running underneath your awareness, and almost every common sleep problem traces back to a disruption in one or both.

Sleep Pressure and the Two-Process Model

The body uses two processes to decide when you sleep. The first is homeostatic sleep pressure, which builds the longer you’re awake. The molecule adenosine accumulates in the brain throughout the day, and high adenosine levels make you feel sleepy. Sleep clears it. By evening, normally, you have enough sleep pressure to fall asleep within 15 to 20 minutes of going to bed.

The second is the circadian rhythm, the body’s roughly 24-hour internal clock that determines when various hormones rise and fall. Even with high sleep pressure, your circadian system has to be in the “it’s nighttime” state for sleep to happen efficiently. This is why an afternoon nap can wreck your nighttime sleep: it bleeds off accumulated sleep pressure without changing your circadian timing.

Cortisol vs Melatonin: The Hormonal Switch

Two hormones do most of the work here. Cortisol rises in the morning and dominates during the day, supporting alertness. Melatonin starts rising in the late evening and dominates at night, supporting sleep. They oppose each other.

The system works when these two hormones stay on their natural curve. It breaks when cortisol stays elevated into the evening (chronic stress, late caffeine, late hard exercise, late bright light) or when melatonin gets suppressed (bright artificial light after sunset, late screens, late meals). If you can’t sleep, one of these signals is usually off.

Three Types of Sleep Trouble

Lumping all sleep problems together hides the fact that they have different causes and different fixes.

Sleep onset insomnia means you can’t fall asleep at the start of the night. Often driven by elevated arousal (sympathetic dominance), late caffeine, mistimed light exposure, or rumination. Fixes target the nervous system and the wind-down process.

Sleep maintenance insomnia means you fall asleep fine but wake in the middle of the night and can’t get back to sleep. Often driven by alcohol metabolism, blood sugar swings, sleep apnea, or chronic stress disrupting the cortisol curve. Fixes target what’s happening during the night.

Early morning waking means you fall asleep fine but wake too early and can’t return. Often driven by depression, advanced circadian phase, or low evening cortisol that rebounds too early. This pattern deserves a doctor’s attention, especially if it’s persistent.

What to Do When You Can’t Sleep Tonight

This is the section to read if you’re searching this from bed. The actions below are immediate, work in the moment, and don’t require waiting weeks for a habit to take effect.

The 20-Minute Rule and Why It Works

If you’ve been in bed more than 20 minutes and sleep isn’t coming, get up. Leave the bedroom. Do something quiet and boring under dim light (a paperback book is ideal; phones aren’t) until you feel sleepy, then return to bed.

The mechanism here is called stimulus control. Your brain learns associations between contexts and states. If you spend hours awake and frustrated in bed, the bed becomes a place your brain associates with being awake and frustrated. Over weeks, this conditioning builds insomnia even when the original trigger is gone. The 20-minute rule breaks the association by making sure the bed is only used for sleep.

Important caveats: don’t check the clock obsessively (that builds anxiety), and don’t use the time out of bed to scroll, work, or do anything stimulating. The goal is boring enough that sleep eventually wins.

Breathing for Sleep Onset

Slow breathing with longer exhalations activates the vagus nerve and shifts you toward parasympathetic dominance, which is the state your nervous system needs to be in for sleep. A 2017 review by Russo and colleagues documented the physiological mechanism: slow breathing improves HRV, baroreflex sensitivity, and parasympathetic tone in healthy adults.

The 4-7-8 protocol is the most popular sleep-onset version. Inhale through the nose for four seconds, hold for seven, exhale through the mouth for eight. Repeat four to eight cycles. The long hold and longer exhale push hard toward calm. Most people feel a noticeable shift within two to three minutes.

If 4-7-8 feels too forced, simpler 1:2 breathing works: any inhale length, exhaled for twice as long. The ratio matters more than the exact numbers.

Cool the Body, Quiet the Mind

Core body temperature has to drop about 1°F for sleep to begin. A bedroom warmer than around 67°F (about 19°C) can be enough to prevent that drop. If you’re tossing and warm, kick off blankets, run a fan, open a window, or move to a cooler spot for a few minutes.

A counterintuitive trick: a warm bath or shower 60 to 90 minutes before bed actually helps sleep, because the post-bath cooling triggers the drop your brain is waiting for. The shower has to end with enough time to let the cooling happen.

Cognitive Shuffling and Other Mental Tools

The reason many people can’t sleep is not biological, it’s that they’re thinking. Specifically, they’re either rehearsing the next day, replaying the previous day, or worrying about not sleeping. Cognitive shuffling interrupts the loop.

Pick a neutral letter, like B. Think of as many words starting with B as you can, visualizing each one for a second or two before moving on (banana, bridge, basketball, bicycle, bench). When you’ve exhausted that letter, move to the next. The randomness occupies the part of your brain that wants to think while making it impossible to follow a worry thread to its conclusion. Most people lose track and fall asleep within 10 to 15 minutes.

A simpler version: name objects in a category (every fruit you can think of, every country, every animal). Same principle, less structure.

Tired But Can’t Sleep: The Wired-But-Exhausted State

This is a specific failure mode worth its own section. You’re exhausted. Your body wants sleep. But your nervous system won’t let you drop. Heart rate is elevated, thoughts won’t slow, you feel jittery despite the fatigue. This is sympathetic over-activation in the presence of high sleep pressure, and it has specific causes worth knowing.

Common drivers: a hard training session within three hours of bed, caffeine consumed later than your body can clear it, an emotionally charged day with no decompression, a high-stress work period running for weeks, or bright light exposure (including screens) right up until lights-out.

The fixes are different from generic sleep advice. Generic advice says “do a relaxing routine.” That doesn’t work when your sympathetic system is already activated, because the system needs an actual physiological brake, not a vague suggestion.

What actually works when you’re tired but wired: prioritize breathing protocols over everything else, since they’re the fastest parasympathetic lever. Get out of bed and do 10 minutes of cyclic sighing or 4-7-8 breathing in a dim room before returning. Take a warm shower if it’s been a while since one. Drop the bedroom temperature lower than usual. If stress is the underlying issue, our coverage on reduce stress techniques goes deeper into the physiology.

What doesn’t help: lying still and trying harder. Watching TV to “wind down” (bright light worsens sympathetic activation). Drinking alcohol (it sedates initially but fragments sleep later). Taking benadryl or another antihistamine without medical guidance (these mask the symptom and don’t address the cause).

Daytime Habits That Decide Whether You Sleep

Tonight’s sleep is largely decided by what you did during the day. The five biggest daytime levers are caffeine, exercise, light exposure, meals, and alcohol.

Caffeine Timing

Caffeine’s effect on sleep is consistently underestimated. A widely-cited 2013 study by Drake and colleagues gave participants 400 mg of caffeine (about two to three cups of coffee) at zero, three, or six hours before bedtime. Even at six hours before bed, total sleep time was reduced by over an hour compared to placebo.

Practical translation: if you sleep at 11 PM, the honest caffeine cutoff is around 2 to 3 PM, not 5 PM as many people assume. People who feel “caffeine doesn’t affect my sleep” usually mean they fall asleep fine. The study measured what happens after that, and the data show fragmented and shorter sleep regardless of subjective onset.

Exercise Timing and Dose

Regular exercise improves sleep quality. A 2015 meta-analysis by Kredlow and colleagues aggregated 66 studies and found regular exercise produces small-to-moderate beneficial effects on total sleep time, sleep efficiency, sleep onset latency, and overall sleep quality.

Timing is less of a problem than commonly believed for most people. The “don’t exercise within three hours of bed” rule applies mainly to intense or near-maximal training. Moderate-intensity training closer to bed generally doesn’t disrupt sleep for healthy, regularly-training adults. What matters more is total weekly exercise dose: hitting general physical activity guidelines (around 150 minutes of moderate activity per week) consistently outperforms perfect timing.

That said, if you’ve noticed your own sleep suffers after evening hard sessions, trust that signal. Individual variation is real.

Light Exposure

The circadian system is calibrated primarily by light. Getting bright outdoor light within the first hour of waking helps anchor cortisol’s morning rise and sets a strong “this is daytime” signal that pays off at bedtime. Even five to ten minutes outdoors on a cloudy day delivers more lux than indoor lighting.

In the other direction, bright artificial light (especially blue-weighted light from screens and LED bulbs) after sunset suppresses melatonin and delays the parasympathetic shift you need for sleep. The fix isn’t banning screens. It’s dimming both screens and ambient room light starting an hour or two before sleep. Lower light cues the body that night is coming.

Meal Timing and Alcohol

Large meals within two hours of bed can disrupt sleep through digestive activity and reflux. Going to bed hungry is also a problem because blood sugar swings can wake you. The middle ground: finish dinner about three hours before bed, with a small snack closer to bed if you tend to wake hungry.

Alcohol deserves its own warning. It sedates initially, which feels like it helps, but it fragments sleep later in the night by suppressing REM and triggering rebound arousal during metabolism. People who use alcohol to fall asleep often report excellent sleep onset and terrible 3 AM wakings. The two are connected.

Supplements With Real Evidence for Sleep

Most sleep supplements have weak evidence. A few have reasonable evidence and warrant inclusion in a serious sleep approach.

Magnesium

Magnesium plays multiple roles in nervous system regulation, including NMDA receptor modulation and GABA support. A 2017 systematic review by Boyle, Lawton, and Dye reviewed magnesium’s effects on subjective anxiety and stress, with effects extending to sleep-related outcomes in some studies. Effects are most consistent in older adults, in people with low baseline magnesium status, and in those with stress-related sleep disruption.

Practical use: 200 to 400 mg of magnesium glycinate or citrate in the evening. Glycinate is generally better tolerated and may have a mild calming effect. Citrate works well but can cause loose stools at higher doses. Oxide is poorly absorbed; skip it. For more detail, see our coverage of magnesium for sleep, magnesium benefits, and the best magnesium supplement options.

Melatonin (Low-Dose, Timing-Specific)

Most over-the-counter melatonin products are dosed at 3 to 10 mg, which is far more than the body produces naturally and tends to oversaturate the system. Effective doses for sleep onset are much smaller, typically 0.3 to 0.5 mg, taken 30 to 90 minutes before bed.

Melatonin works best for circadian-rhythm problems (jet lag, shift work, delayed sleep phase) rather than general insomnia. It’s a timing signal, not a sedative. If you’re using high-dose melatonin and not seeing benefit, switching to low-dose may actually work better than going higher.

What to Skip

Valerian root, chamomile, passionflower, and most “sleep blends” have weak or inconsistent evidence. Some people find them helpful subjectively, which is fine, but they shouldn’t be the foundation of a sleep approach. CBD products for sleep have mixed evidence and significant quality-control issues at the consumer level.

L-theanine, often paired with magnesium, has decent evidence for general relaxation and may modestly help sleep onset in some people. It’s a reasonable addition, not a primary lever.

What to Do When You Can’t Sleep Long-Term: CBT-I and Self-Applied Elements

Chronic insomnia, defined as trouble falling or staying asleep at least three nights a week for three or more months, doesn’t respond well to ad-hoc fixes. The gold-standard treatment is cognitive behavioral therapy for insomnia (CBT-I).

CBT-I has several components. Three of them can be self-applied with reasonable safety, and we cover them here. The full protocol, especially the sleep restriction component, is best delivered by a trained provider.

Stimulus control (self-applicable): the 20-minute rule described earlier is one piece of this. Add to it: only use the bed for sleep and intimacy, get out of bed at the same time every morning regardless of how the night went, and avoid napping during the day while you’re working on the problem.

Cognitive reframing (self-applicable): track and challenge the catastrophic thoughts about sleep. “If I don’t sleep tonight, tomorrow is ruined” is a worry that increases arousal and worsens sleep. The accurate reframe is closer to “one bad night is normal and recoverable; my body will eventually demand sleep.” Writing down worries before bed, with planned solutions for tomorrow, also helps offload them.

Sleep restriction (use caution, ideally with a professional): this technique reduces the time you spend in bed to match your actual sleep time, increasing sleep efficiency and pressure. Done correctly, it works powerfully. Done incorrectly, it can cause severe daytime impairment in people who shouldn’t be restricting further. If you’re working through a CBT-I protocol on your own, leave this for a trained provider.

When to See a Doctor

Self-help approaches work for most sleep problems most of the time. They don’t work for everything, and stubborn sleep issues deserve professional evaluation rather than another round of supplement experiments.

Signs that warrant a doctor visit: insomnia symptoms persisting for more than three weeks despite reasonable sleep hygiene; daytime fatigue, mood disruption, or impairment that comes with the sleep problem; loud snoring, gasping, or witnessed pauses in breathing during sleep (likely sleep apnea screening); persistent early morning waking, especially with low mood (possible depression); restless leg sensations or limb movements at night; significant sleep onset problems in someone with no obvious lifestyle triggers; and any sleep problem that’s getting steadily worse.

Sleep apnea deserves particular emphasis because it’s common, dangerous, and routinely missed. People with sleep apnea often report “sleeping fine” but feel exhausted during the day. If anyone has ever told you that you snore loudly or stop breathing during sleep, ask your doctor about a sleep study. Treatment, usually with a CPAP machine or oral device, is genuinely life-changing for people who need it, and home remedies do nothing for the underlying problem.

The honest framing: techniques in this article work as a foundation. They don’t substitute for professional care when professional care is needed.

Frequently Asked Questions

Why can't I sleep even when I'm tired?
This is usually sympathetic nervous system over-activation in the presence of high sleep pressure. Common causes include late caffeine, late hard exercise, an emotionally activated day, chronic stress, or bright light exposure right up until lights-out. The body wants sleep but the nervous system won't downshift to allow it. The fastest fix is slow breathing with extended exhalation (4-7-8 or cyclic sighing) in a dim room until you feel the shift toward calm.
Is it bad to lie awake in bed?
Yes, if you do it for long stretches and frequently. Spending hours awake in bed teaches your brain to associate the bed with being awake and frustrated, which gradually builds conditioned insomnia. The recommendation from sleep researchers is the 20-minute rule: if you've been in bed without sleep for around 20 minutes, get up, do something quiet and boring under dim light, and return only when you feel sleepy. Protecting the bed-equals-sleep association matters more than people realize.
How long does it take to fix insomnia?
Acute sleep problems often resolve within a few nights once the underlying trigger is removed. Chronic insomnia, defined as three or more nights of trouble per week for three or more months, typically takes longer. CBT-I, the gold-standard treatment for chronic insomnia, usually produces meaningful improvements within four to eight weeks. Lifestyle changes like consistent timing, light exposure, and caffeine cutoffs tend to show effects within one to three weeks. Be patient with the process and avoid switching strategies every few nights.
Do sleeping pills work?
Prescription sleep medications can be effective short-term and have a role in specific situations, but they have meaningful downsides. Tolerance develops, rebound insomnia is common when stopping, and some classes have significant side effects or dependency risks. Most current guidelines recommend CBT-I as first-line treatment for chronic insomnia, not medication. Over-the-counter sleep aids based on antihistamines (like diphenhydramine) can sedate but don't produce normal sleep architecture and often cause next-day grogginess. Any sleep medication decision is worth making with a doctor.
What time should I stop drinking coffee?
For most adults, a hard cutoff around 2 PM for the last caffeine of the day is a reasonable starting point. Research has shown that even 400 mg of caffeine taken six hours before bedtime reduces total sleep time by over an hour, so the common belief that an afternoon coffee is fine often isn't accurate. Individual sensitivity varies based on genetics (CYP1A2 enzyme activity), age, and tolerance, so some people need an earlier cutoff. If you're working on a sleep problem, treat the 2 PM cutoff as the rule and adjust later only if your sleep stays solid.
#sleep #insomnia #sleep onset #sleep hygiene #CBT-I #circadian rhythm #magnesium #evidence-based

Free newsletter

Evidence-based fitness and health insights, delivered to your inbox.

No spam. Unsubscribe at any time.

Medical disclaimer: Content is for informational purposes only and is not a substitute for professional medical advice. Always consult a qualified healthcare provider before starting any new fitness or supplement program.

Published · Last updated