What to Do When You Can’t Sleep at Night

If you’re lying awake and can’t fall asleep, the single most effective thing you can do right now is get out of bed. It sounds counterintuitive, but staying in bed while frustrated trains your brain to associate the bed with wakefulness. Go to another room, do something quiet and boring, and return only when you feel genuinely sleepy. That one habit, repeated consistently, is the cornerstone of the most effective behavioral treatment for insomnia.

Beyond that immediate step, there are breathing techniques, environment changes, and daily habits that make a real difference. Here’s what actually works.

Get Out of Bed if You’re Not Sleeping

When you’ve been tossing for roughly 15 to 20 minutes (don’t watch the clock, just estimate), get up. Move to a different room and do something that doesn’t stimulate you too much: flip through a dull magazine, listen to a quiet podcast, fold laundry. The goal is to shift your attention away from the frustration of not sleeping and toward something mildly boring. When your eyelids start drooping, go back to bed.

If you climb back in and the same restlessness returns, get up again. Repeat as many times as needed. This technique, called stimulus control, is a core part of cognitive behavioral therapy for insomnia (CBT-I), which outperforms sleeping pills in long-term studies. The logic is simple: your bed should cue sleep, not anxiety about sleep. Over days and weeks, this retraining works remarkably well.

Use Your Breathing to Trigger Relaxation

Your nervous system has a built-in calm-down switch. Deep, slow breathing activates the parasympathetic nervous system, which counteracts the stress response keeping you alert. One structured way to do this is the 4-7-8 method: inhale through your nose for four counts, hold for seven counts, then exhale slowly through your mouth for eight counts. The extended exhale is the key part. It forces your heart rate down and signals your body that it’s safe to rest.

You can do this in bed or in another room. Four to six cycles is usually enough to notice a shift. If counting feels stressful, just focus on making each exhale longer than each inhale. The ratio matters more than the exact numbers.

Try Progressive Muscle Relaxation

Another technique that works well at night is deliberately tensing and then releasing each muscle group, starting at your feet and working upward. Curl your toes and arch your feet, hold briefly, then let them go completely. Move to your calves, thighs, buttocks, lower back, abdomen, upper back, shoulders, arms, hands, neck, jaw, and forehead. Tense each area for about five seconds, then release.

This works because physical tension and mental tension feed each other. Most people don’t realize how much residual tightness they’re carrying until they systematically let it go. By the time you reach your forehead, your body often feels noticeably heavier and more ready for sleep.

Cool Your Bedroom Down

Your body temperature naturally drops as you fall asleep, and a warm room fights that process. The ideal bedroom temperature for adults is 60 to 67°F (15 to 19°C). That range helps stabilize REM sleep, the stage critical for emotional processing and memory. If your room is warmer than that, even a fan or cracking a window can help. Light bedding and breathable fabrics make a difference too.

Why Your Brain Won’t Shut Off

Understanding what’s happening biologically can make sleeplessness feel less alarming. Throughout the day, a compound called adenosine accumulates in your brain as a natural byproduct of energy use. The longer you’ve been awake, the more adenosine builds up, and the sleepier you feel. This is your sleep pressure, and it’s one of two systems that control when you fall asleep (the other is your circadian clock, which responds to light).

The problem is that stress, stimulation, or poor timing can override even strong sleep pressure. Caffeine, for example, blocks adenosine receptors directly, which is why a late afternoon coffee can leave you wired at midnight even though your body has been awake for 16 hours. Anxiety does something similar by keeping your fight-or-flight system activated, essentially telling your brain that staying alert is more important than resting.

Cut Caffeine Earlier Than You Think

Caffeine has a half-life of about five to six hours, meaning half the caffeine from your 3 p.m. coffee is still circulating at 9 p.m. Research shows that caffeine consumed even six hours before bedtime can disrupt sleep quality, sometimes without you noticing the connection. A good cutoff is early to mid-afternoon. If you’re sensitive to caffeine, noon may be more appropriate. Tea, chocolate, and some medications also contain caffeine worth accounting for.

Alcohol Makes It Worse, Not Better

A drink before bed might help you fall asleep faster, but it reliably ruins the second half of your night. Alcohol increases deep sleep early on while suppressing REM sleep. Then, as your body metabolizes the alcohol, a rebound effect kicks in: your sympathetic nervous system activates, causing fragmented sleep, more awakenings, and vivid or anxious dreams as your brain tries to recover the lost REM time. The net result is that you wake up feeling unrested even after a full night in bed. REM suppression also impairs emotional regulation and memory consolidation, which means the effects carry into the next day.

Screen Light and Your Internal Clock

Bright screens suppress melatonin, the hormone that signals your brain it’s nighttime. Harvard Health recommends avoiding bright screens two to three hours before bed. If that’s not realistic, use your phone’s night mode, dim the brightness as low as it goes, and keep overhead lights low in the evening. The goal is to let your brain register that it’s getting dark outside, which it can’t do if you’re staring into a bright rectangle.

Melatonin as a Short-Term Tool

If your sleep timing is off, a low dose of melatonin can help reset it. The NHS recommends 2 mg of slow-release melatonin taken one to two hours before your desired bedtime for short-term use. For longer-term sleep problems, doses can gradually increase up to 10 mg under medical guidance, though most people do fine at the lower end. Melatonin works best for circadian timing issues (like jet lag or a shifted schedule) rather than for general anxiety-driven insomnia. It’s not a sedative. It tells your brain “it’s nighttime now,” which only helps if your brain wasn’t getting that signal already.

When Sleeplessness Becomes a Pattern

A bad night here and there is normal. Chronic insomnia is a different situation, defined clinically as difficulty falling or staying asleep at least three nights per week for three months or longer, despite having adequate opportunity to sleep. If that describes your experience, and it’s affecting your mood, concentration, or daily functioning, the most effective treatment is CBT-I. It typically runs six to eight sessions and addresses both the behavioral habits and the thought patterns that perpetuate insomnia. It works better than medication for most people and, unlike sleeping pills, the benefits last after treatment ends.