How to Get Rid of Bad Anxiety at Night for Good

Nighttime anxiety feeds on stillness. During the day, your brain stays occupied, but the moment you lie down in a dark, quiet room, worries rush in with nothing to compete against. The good news: specific techniques can break this cycle, and most of them work the first night you try them. The key is addressing both the mental loop and the physical tension that keep you wired when you should be winding down.

Why Anxiety Gets Worse at Night

Your nervous system has two modes: one that revs you up and one that calms you down. Anxiety activates the revved-up mode, raising your heart rate, tensing your muscles, and sharpening your alertness. That’s useful during a crisis but disastrous for sleep. When you climb into bed already carrying the day’s stress, your body interprets the quiet as an opportunity to process every unresolved problem at once.

This creates a frustrating feedback loop. You worry about something, then you notice you’re not falling asleep, then you start worrying about not sleeping, which makes sleep even harder. Over time, your brain can start associating the bed itself with anxiety rather than rest. Breaking that association is one of the most effective long-term fixes.

Use a Breathing Pattern That Triggers Calm

The fastest way to dial down acute anxiety is through your breath, specifically by making your exhale longer than your inhale. A technique studied at Stanford Medicine called cyclic sighing works in under five minutes: breathe in through your nose until your lungs feel comfortably full, then take a second, shorter sip of air to expand them fully. Slowly exhale through your mouth until every bit of air is gone. Repeat for several rounds.

This works because long exhalation activates the part of your nervous system responsible for slowing heart rate and calming your body. You’re essentially flipping a switch from alert mode to rest mode. Unlike counting breaths or generic “deep breathing,” the double inhale followed by an extended exhale produces measurable reductions in anxiety and can be done lying in bed without any setup.

Get Out of Bed if You Can’t Sleep

This sounds counterintuitive, but it’s one of the most well-supported strategies in sleep medicine. The principle, called stimulus control, comes from cognitive behavioral therapy for insomnia. The rules are straightforward:

  • Only go to bed when you feel genuinely sleepy, not just tired or because it’s “bedtime.”
  • If you’ve been lying awake for roughly 15 to 20 minutes, get up and move to another room. Do something low-key (reading a physical book, light stretching) until sleepiness returns.
  • Return to bed only when you feel sleepy again. Repeat as needed.
  • Wake up at the same time every morning, regardless of how the night went. This anchors your internal clock.
  • Avoid long naps during the day, which dilute your sleep drive at night.

The goal is to retrain your brain so that lying in bed equals sleep, not anxiety. If you spend hours tossing and turning night after night, your bed gradually becomes a cue for wakefulness. Getting up and resettling breaks that pattern. It can feel worse for the first few nights, but most people notice improvement within one to two weeks.

Schedule a “Worry Window” Earlier in the Evening

One reason anxiety floods in at bedtime is that it’s your first quiet moment to process the day. You can short-circuit this by giving your worries a dedicated slot earlier in the evening. Set aside 30 minutes, at the same time and place each day, specifically for thinking through whatever is bothering you. Write your worries down, consider possible next steps, then close the notebook and move on.

When anxious thoughts pop up later at bedtime, you remind yourself they’ve already been addressed, or that they’ll have their slot tomorrow. A meta-analysis of studies on this technique found it significantly reduced both how often people worried and how long each worry episode lasted. The effect size was modest but consistent, and the technique costs nothing and takes no special training. The key is keeping it at least an hour or two before bed so you’re not ramping up right before sleep.

Progressive Muscle Relaxation

Anxiety stores itself physically. You may not notice you’re clenching your jaw or tightening your shoulders until you actively check. Progressive muscle relaxation works through the body systematically, releasing that stored tension group by group. Harvard Health recommends starting at your feet: curl your toes and arch your feet, hold briefly, then let them go completely and sink into the mattress. Move upward through your calves, thighs, buttocks, lower back, abdomen, upper back, shoulders, arms, hands, neck, jaw, and forehead.

Each cycle of tension and release takes only a few seconds per muscle group, and the full sequence can be done in 10 to 15 minutes. The contrast between deliberate tension and release teaches your nervous system what relaxation actually feels like, which is surprisingly useful for people who’ve been anxious so long they’ve forgotten. Many people fall asleep before reaching their forehead.

Cut Caffeine Earlier Than You Think

Caffeine has a half-life anywhere between 2 and 12 hours, meaning half of it can still be circulating in your system long after you’ve forgotten your afternoon coffee. For someone who metabolizes caffeine slowly, a 3 p.m. latte can still be elevating heart rate and sharpening alertness at midnight, mimicking the physical sensations of anxiety.

The general recommendation is to stop caffeine at least eight hours before bed. If you go to sleep at 10 p.m., that means a 2 p.m. cutoff. If your nighttime anxiety has a strong physical component (racing heart, restlessness, chest tightness), try pushing that cutoff to noon for two weeks and see if the physical symptoms ease. Caffeine doesn’t just disrupt sleep onset; it also fragments sleep architecture, meaning even if you fall asleep, you may not stay in the deeper stages long enough to feel rested.

Magnesium as a Sleep Support

Magnesium plays a role in regulating your nervous system, and many people don’t get enough of it through diet alone. Supplementing with magnesium glycinate, a form that absorbs well and is gentle on the stomach, is one of the more commonly recommended options for sleep support. The upper limit for supplemental magnesium is 350 milligrams per day; going above that can cause digestive issues like cramping and diarrhea. Starting at a lower dose and building up is reasonable.

Magnesium won’t knock you out like a sedative. It works more like removing a barrier to sleep by helping muscles relax and supporting the calming arm of your nervous system. It’s most useful as one piece of a larger strategy rather than a standalone fix.

Nighttime Anxiety vs. Nocturnal Panic Attacks

There’s a meaningful difference between lying awake with racing thoughts and jolting awake in a state of terror. Nocturnal panic attacks wake you from sleep with a racing heart, sweating, difficulty breathing, and sometimes a feeling like you’re having a heart attack. They tend to produce more severe breathing symptoms than daytime panic attacks, including gasping for air or a choking sensation.

The distinguishing feature is awareness. With a panic attack, you wake up fully and know something alarming is happening, and it can take a long time to fall back asleep. Night terrors, by contrast, are a sleep disorder where you may thrash and scream but typically fall back asleep quickly and won’t remember it in the morning. If you’re regularly waking in full-body panic, that pattern points toward panic disorder, which responds well to targeted treatment beyond the self-help strategies above.

When Self-Help Isn’t Enough

The techniques in this article work well for situational and mild-to-moderate anxiety. But anxiety exists on a spectrum. Clinicians use screening tools where scores above a certain threshold suggest a generalized anxiety disorder that benefits from professional support. A practical self-check: if your anxiety is present most days, interferes with work or relationships, and hasn’t responded to consistent use of the strategies above over several weeks, you’re likely past the point where self-management alone is sufficient. Cognitive behavioral therapy, particularly versions designed for insomnia, has a strong track record for nighttime anxiety and often works within six to eight sessions.