If you’ve been lying in bed staring at the ceiling for more than 15 or 20 minutes, the single best thing you can do is get up. It sounds counterintuitive, but staying in bed while frustrated actually trains your brain to associate your bed with wakefulness. What follows is a full toolkit: what to do right now if you can’t sleep, what to change during the day so tonight goes better, and how to tell when sleeplessness has crossed into something worth investigating.
Get Out of Bed After 20 Minutes
This is the cornerstone of stimulus control therapy, one of the most well-supported techniques in sleep medicine. If you haven’t fallen asleep (or back to sleep) within about 15 to 20 minutes, move to another room and do something quiet until you feel genuinely drowsy. Then return to bed. Repeat as many times as needed.
The key is choosing activities that occupy your mind just enough. Reading, doing a crossword puzzle, listening to soft music, drawing, meditating, or watching light television all work. The activity shouldn’t be so stimulating that your brain revs up, and it shouldn’t be so boring you have no reason to leave bed in the first place. Avoid anything on a bright screen if you can, since the light works against you (more on that below).
Over time, this practice retrains your brain so that getting into bed becomes a strong cue for sleep rather than a cue for frustration.
Calm Your Body With Controlled Breathing
Racing thoughts and physical tension are the two biggest blockers when you’re lying awake. A breathing technique called 4-7-8 breathing can help with both. Here’s how it works: inhale quietly through your nose for a count of four, hold your breath for a count of seven, then exhale slowly through your mouth for a count of eight. Repeat three or four cycles.
The extended exhale activates your parasympathetic nervous system, which is the branch responsible for shifting your body out of fight-or-flight mode and toward calm. You’re essentially giving your nervous system a manual override. It won’t knock you out instantly, but it lowers your heart rate and eases muscle tension, which makes sleep possible.
Distract a Busy Mind With Cognitive Shuffling
If your problem is less about physical tension and more about a brain that won’t stop thinking, try the cognitive shuffle. It works by flooding your mind’s eye with random, meaningless images, which crowds out the planning, worrying, or replaying that keeps you awake.
Pick any emotionally neutral word with at least five letters. “BEDTIME” works. Take the first letter, B, and think of as many words starting with B as you can, visualizing each one: banana, bicycle, barn, butterfly. Spend a few seconds picturing each image. When you run out of B words or get bored, move to the next letter, E, and repeat. If you somehow make it through the whole word without falling asleep, pick a new word like “SATURN” and start over. Most people don’t get past the third or fourth letter.
The reason this works is that the brain interprets random, unconnected imagery as a signal that nothing important is happening, which makes it safe to drift off.
Cool Your Bedroom Down
Your core body temperature naturally drops as part of the process that initiates sleep. A warm room fights that process directly. The ideal bedroom temperature for adults is between 60 and 67°F (15 to 19°C). If your room is warmer than that, your body temperature stays elevated, and you’ll have a particularly hard time reaching the deeper stages of sleep. Heat is one of the biggest disruptors of REM sleep, the phase critical for memory and emotional regulation.
If you don’t have air conditioning, a fan pointed near (not directly at) your body, lighter bedding, or even a cool shower before bed can help your core temperature drop enough to get things moving in the right direction.
Cut Screens Two to Three Hours Before Bed
Blue light from phones, tablets, and laptops suppresses melatonin, the hormone that signals your brain it’s time to sleep. In one experiment at Harvard, 6.5 hours of blue light exposure suppressed melatonin for about twice as long as green light of the same brightness and shifted the body’s internal clock by three hours. That means scrolling your phone at 11 p.m. can push your body’s sense of “bedtime” to 2 a.m.
The standard recommendation is to avoid bright screens starting two to three hours before bed. If that’s not realistic, use night mode settings that reduce blue light output, keep the screen dim, and hold it farther from your face. These are imperfect solutions, but they reduce the dose.
Watch Your Caffeine Timing
Caffeine works by blocking a chemical called adenosine that builds up in your brain throughout the day, creating increasing pressure to sleep. When caffeine sits in those receptors instead, you don’t feel that pressure, even though it’s still accumulating. The problem is caffeine’s half-life, the time it takes your body to clear just half of it, ranges from 2 to 12 hours depending on your genetics and metabolism.
For most people, cutting off caffeine at least eight hours before bed is the minimum safe window. If you’re a slow metabolizer (you’ll know because even afternoon coffee seems to affect your sleep), you may need to push that cutoff to 10 or 12 hours. A 10 a.m. last cup is a reasonable experiment if you’re regularly struggling at night.
Melatonin: What Actually Works
Melatonin supplements can help, but they’re widely misunderstood. The effective dose is much lower than what most people take. A 2 mg slow-release tablet, taken one to two hours before bed for short-term sleep problems, is the standard starting point. For ongoing difficulty, the same dose taken 30 minutes to an hour before bed is typical. Higher doses don’t produce better sleep and can cause grogginess the next day.
Timing matters more than dose. Melatonin isn’t a sedative. It’s a signal to your brain that darkness has arrived and sleep should begin. Taking it too late, or taking a massive dose hoping it will work like a sleeping pill, misses the point entirely.
When Sleeplessness Becomes Chronic Insomnia
Everyone has a bad night occasionally. That’s normal. The clinical threshold for insomnia is trouble falling asleep, staying asleep, or waking too early at least three nights per week for at least one month. If that pattern sounds familiar, it’s no longer a behavioral problem you can fix with breathing exercises alone.
The gold-standard treatment for chronic insomnia is cognitive behavioral therapy for insomnia, often abbreviated CBT-I. It typically includes sleep restriction, which sounds harsh but is effective: you temporarily limit the time you spend in bed to match the amount of time you’re actually sleeping. If you’re only sleeping five and a half hours but spending eight hours in bed, your initial “sleep window” gets set at five and a half hours. Once you’re sleeping for at least 85% of your time in bed (a metric called sleep efficiency), the window gradually expands. The goal is to consolidate your sleep into a solid block rather than spreading thin, fragmented rest across a long night. CBT-I programs are available through therapists and through several validated apps.
Signs Your Sleep Problem May Be Medical
Not all sleep difficulty is insomnia. Sleep apnea, a condition where your airway partially or fully closes during sleep, can look a lot like insomnia from the inside. You wake up repeatedly, feel unrested, and can’t figure out why. But the underlying cause is physical, not behavioral, and the clues are different.
Watch for loud snoring (especially with gasping or choking sounds), waking up with a dry mouth or headache, excessive daytime sleepiness to the point of dozing off involuntarily, and difficulty with concentration or memory. These symptoms point toward a breathing problem during sleep rather than a brain that won’t shut off. A sleep study can confirm the diagnosis, and treatment is straightforward once identified.

