How to Stop Anxiety When Trying to Sleep

Nighttime anxiety is one of the most common reasons people struggle to fall asleep, and it has a clear biological explanation: your body’s stress system is fighting your sleep system, and the stress system is winning. The good news is that several techniques can tip the balance back, some working in minutes. The key is understanding that trying harder to sleep actually makes the problem worse, and the most effective strategies work by lowering your body’s arousal level or redirecting your mind away from the thoughts keeping it alert.

Why Anxiety Gets Worse at Bedtime

During the day, your brain is occupied. Tasks, conversations, and stimulation keep anxious thoughts from dominating. When you lie down in a quiet, dark room, that competition disappears, and worry fills the vacuum. This isn’t a character flaw. It’s how the brain works when it loses competing input.

There’s also a hormonal component. Your body’s main stress hormone, cortisol, normally drops to its lowest levels in the hours before sleep. This dip is necessary for sleep to begin. But when you’re sleep-deprived or chronically stressed, cortisol stays elevated into the late afternoon and evening, keeping your nervous system in a state of low-level alertness right when it should be winding down. Poor sleep raises evening cortisol, which makes the next night’s sleep harder, creating a cycle that feeds itself.

On top of this, many people develop what researchers call “sleep effort,” a form of performance anxiety about falling asleep. You start monitoring yourself (Am I relaxed yet? Why am I still awake?), and that monitoring activates the same alert state you’re trying to shut off. The techniques below work because they interrupt these specific mechanisms.

Breathing to Shift Your Nervous System

The fastest way to counteract anxiety’s physical effects is controlled breathing with a longer exhale than inhale. When your exhale is roughly twice as long as your inhale, it stimulates the branch of your nervous system responsible for calming you down and suppresses the branch responsible for the fight-or-flight response.

The 4-7-8 method is a well-studied version of this. Inhale quietly through your nose for 4 counts. Hold your breath for 7 counts. Exhale slowly through your mouth for 8 counts, making a soft whooshing sound. One cycle takes about 20 seconds, which means your breathing rate drops to roughly 3 breaths per minute, far slower than your normal rate. Research published in Physiological Reports found that this pattern measurably increases parasympathetic nervous system activity, the body’s “rest and digest” mode, while reducing sympathetic (stress) activity. The breath-hold portion also increases oxygen saturation in your blood, which further dials down your body’s alarm signals.

Start with 4 cycles. If the 7-count hold feels uncomfortable, shorten it to 4 or 5 counts while keeping the exhale long. The ratio matters more than the exact numbers.

Redirect Your Mind With Cognitive Shuffling

When anxious thoughts loop, your brain is generating coherent, narrative-style thinking: planning, rehearsing, worrying. This type of structured thought keeps the brain alert. Sleep onset, by contrast, is characterized by scattered, random, disconnected thoughts. Cognitive shuffling mimics that pre-sleep pattern and tricks your brain into the transition.

Here’s how it works. Pick a random, emotionally neutral word, like “plant.” Take the first letter, P, and visualize as many unrelated objects as you can that start with P: penguin, piano, pillow, pond. Picture each one briefly before moving to the next. When you run out, move to the second letter, L, and repeat. Most people don’t make it to the third letter.

The technique works through a push-and-pull mechanism, according to Alanna Hare, a sleep medicine specialist at Royal Brompton Hospital in London. It pulls you toward sleep by generating the kind of loose, image-based thinking your brain produces naturally as you drift off, while simultaneously pushing away the structured worry loops that keep you alert. The key is choosing genuinely boring words. Animals, grocery items, and household objects work well. Anything connected to work, relationships, or current events can re-trigger alertness.

Stop Trying to Fall Asleep

This sounds counterintuitive, but one of the most effective clinical techniques for sleep-onset anxiety is paradoxical intention: deliberately trying to stay awake. You lie in bed with the lights off and gently challenge yourself to keep your eyes open and remain awake as long as possible. No screens, no reading, just resting with the quiet intention of not sleeping.

The logic is straightforward. People with sleep anxiety tend to treat falling asleep as something they can force through effort. That effort creates frustration, which activates the autonomic nervous system, which makes sleep harder. Paradoxical intention removes the pressure entirely. When you stop trying to sleep, you stop monitoring whether you’re sleeping, and the anxiety around the process dissolves. Developed in the 1970s as an insomnia treatment, it remains a component of clinical sleep therapy programs because it directly targets the performance anxiety that keeps people awake.

The 15-Minute Rule

If you’ve been lying in bed anxious for what feels like a long time, get up. This is one of the core rules of stimulus control therapy, the behavioral backbone of clinical insomnia treatment. The guidelines are simple:

  • Only get into bed when you feel genuinely sleepy, not just tired or because it’s “bedtime.”
  • If you’re not asleep within about 15 to 20 minutes, get out of bed and go to another room.
  • Do something quiet and low-stimulation (reading a physical book, light stretching, listening to calm audio) until you feel sleepy again, then return to bed.
  • Repeat as many times as needed throughout the night.

This feels punishing at first, but it serves an important purpose. Your brain forms associations between locations and activities. If you spend hours lying in bed anxious, your brain starts associating the bed with anxiety and wakefulness instead of sleep. Getting up when you can’t sleep breaks that association and rebuilds the bed as a cue for sleep only. Over time, this retraining is one of the most powerful tools available for chronic sleep anxiety.

Move Your Worrying to Earlier in the Day

Much of what keeps you awake at night is unprocessed worry that had no other outlet during the day. Scheduled worry time gives it one. The concept is simple: pick a specific time, place, and duration for worrying each day, and make it the same every day. Twenty minutes is a common recommendation. When anxious thoughts pop up at other times, you note them briefly (a notepad works well) and postpone them to the designated period.

Two important rules make this work. First, the worry period should not be close to bedtime. Early evening or late afternoon is typical. Second, you don’t have to use the full 20 minutes. If you sit down and find the worries feel less urgent than they did at 2 a.m., that’s the point. Many nighttime worries lose their power when you examine them in a well-lit room at 6 p.m. Over a few weeks, this practice trains your brain to stop treating bedtime as the default processing window for unresolved concerns.

Set Up Your Room for Lower Arousal

Your body needs its core temperature to drop slightly to initiate sleep. An anxious state raises your temperature and heart rate, working against this process. Keeping your bedroom between 60 and 67°F (15 to 19°C) supports the temperature drop. Anything above 70°F is generally too warm for good sleep onset, especially if anxiety is already raising your baseline arousal.

Beyond temperature, minimize sensory input that might feed alertness. Phones and clocks are two of the worst offenders for anxious sleepers. Checking the time triggers rapid mental math about how many hours of sleep you’ll get, which spikes anxiety instantly. Turn clocks away from view and put your phone in another room or face-down across the room. If you use your phone as an alarm, a standalone alarm clock solves the problem for a few dollars.

Magnesium and the Calming Signal

Magnesium plays a role in nervous system regulation that’s relevant to sleep anxiety. In the brain, it acts as a natural brake on excitatory signaling. It blocks a receptor that, when overactive, contributes to neural excitation and anxiety. It also appears to have some activity at the same receptor sites targeted by anti-anxiety medications, promoting a calming effect.

A systematic review in Cureus examined multiple studies on magnesium supplementation for anxiety and sleep quality. The results were generally positive, though dosing varied widely across studies. Magnesium glycinate is the form most commonly recommended for sleep because glycine itself has calming properties and the form is well-absorbed with less digestive irritation than cheaper alternatives like magnesium oxide. Many adults don’t get enough magnesium through diet alone, so supplementation may help restore levels that support normal nervous system function. If you’re considering it, starting with a modest dose in the evening is typical.

When the Pattern Persists

Occasional nighttime anxiety is normal, especially during stressful periods. But if it’s happening most nights for three months or more, it may reflect a deeper pattern. Sleep disturbance is a core feature of generalized anxiety disorder and post-traumatic stress disorder, and it shows up in up to 68% of people with panic disorder and 30 to 50% of people with social anxiety. In these cases, the sleep problem isn’t separate from the anxiety. It’s part of it.

Cognitive behavioral therapy for insomnia (CBT-I) is the most effective treatment for chronic sleep anxiety. It combines the techniques described above, stimulus control, cognitive restructuring, sleep restriction, and relaxation training, into a structured program typically lasting 6 to 8 sessions. It outperforms sleep medication in long-term studies because it addresses the underlying patterns rather than masking them. Many therapists offer it, and several validated digital programs exist for people who prefer self-guided formats.