Why Am I Having Trouble Sleeping? Common Causes

About 37% of American adults report not getting enough sleep, so if you’re lying awake wondering what’s wrong, you’re far from alone. The causes range from simple habits you can fix tonight to underlying conditions worth investigating. Most sleep trouble falls into a few predictable categories: what you consume, what surrounds you, what’s on your mind, and occasionally, what’s happening in your body without you realizing it.

Your Body’s Sleep Signal May Be Disrupted

Sleep depends on a chemical called melatonin, which your brain releases in response to darkness. Light suppresses that signal, and not all light is equal. Short-wavelength light (the blue-toned light from phones, tablets, and laptops) is particularly effective at shutting down melatonin production. Research published in PNAS found that the wavelengths most disruptive to melatonin shift over the course of an exposure, but blue light in the 440 to 485 nanometer range is consistently the strongest suppressor.

This means scrolling your phone in bed isn’t just mentally stimulating. It’s actively telling your brain it’s daytime. Built-in blue light filters on devices help somewhat, but the evidence on their effectiveness is mixed. A more reliable approach is to stop using screens entirely in the hours before bed. One study found measurable decreases in sleep quality after just three hours of blue light exposure, suggesting that cutting off screens well before bedtime matters more than dimming them slightly.

Caffeine Lingers Longer Than You Think

Caffeine has a half-life of three to six hours, meaning half the caffeine from your afternoon coffee is still circulating in your bloodstream up to six hours later. But even after that, the remaining caffeine continues to affect your sleep architecture. A 2024 clinical trial found that a large dose of caffeine consumed 12 hours before bedtime still reduced deep sleep by about 20 minutes. At eight hours before bed, deep sleep dropped by around 15 minutes. At four hours, the loss was nearly 30 minutes.

Deep sleep is the physically restorative stage. Losing even 15 to 20 minutes of it can leave you feeling unrested the next day, even if you slept a full eight hours by the clock. If you’re having trouble sleeping and you drink coffee, tea, or energy drinks in the afternoon, that’s one of the first things worth changing. Switching to a morning-only caffeine routine is one of the simplest, most effective sleep interventions available.

Alcohol Fragments Your Sleep Cycles

A drink or two in the evening might make you feel drowsy, but alcohol disrupts sleep in a specific, measurable way. As your body metabolizes alcohol during the night, it causes repeated micro-awakenings that pull you out of deeper sleep stages and back into light sleep. Each of these brief arousals cuts into your REM sleep, the stage critical for memory, emotional processing, and feeling mentally sharp the next day. You may not remember waking up, but the damage to your sleep quality is real.

If you do drink, finishing at least three hours before bedtime gives your body a head start on processing the alcohol before sleep begins.

Your Bedroom May Be Too Warm

Your core body temperature needs to drop slightly for sleep to begin. A room that’s too warm fights this process directly. Sleep specialists recommend keeping your bedroom between 60 and 67°F (15 to 19°C), which feels cooler than most people expect. If your bedroom is 72°F or higher, that alone could explain difficulty falling asleep. For babies and toddlers, the ideal range is slightly warmer, between 65 and 70°F.

Beyond temperature, noise and light matter in obvious but often overlooked ways. Blackout curtains, a fan or white noise machine, and removing standby lights from electronics all reduce the small disruptions that fragment sleep without fully waking you.

Stress and Anxiety Are the Most Common Culprits

When your mind races at bedtime, it’s not a character flaw. It’s your nervous system stuck in a state of alertness. Stress hormones like cortisol are supposed to drop in the evening, but worry, rumination, and unresolved tension keep them elevated. This creates a frustrating cycle: you can’t sleep because you’re anxious, and sleep deprivation makes anxiety worse the next day.

One nutrient connection worth noting is magnesium, which plays a direct role in calming the nervous system. Magnesium binds to GABA receptors in the brain, activating the same calming system that anti-anxiety medications target. Research from the CARDIA study found that higher magnesium intake was associated with both longer sleep duration and better sleep quality. A clinical trial showed that magnesium supplementation over eight weeks significantly increased sleep duration and reduced the time it took to fall asleep in older adults. Many people are mildly deficient without knowing it, since magnesium is depleted by stress, caffeine, and processed food.

Practical approaches for a racing mind include writing down tomorrow’s tasks before bed (externalizing the mental load), keeping a consistent wind-down routine, and breathing techniques that activate your body’s relaxation response. Slow exhales that are longer than your inhales, such as breathing in for four counts and out for six, directly shift your nervous system toward sleep readiness.

When the Problem Might Be Medical

If you’ve cleaned up your habits and still can’t sleep well, a medical cause is worth considering. Sleep apnea is far more common than most people realize. Roughly 15 to 30% of men and 10 to 15% of women have some degree of obstructive sleep apnea, a condition where the airway repeatedly collapses during sleep, causing brief awakenings throughout the night. The classic sign is loud snoring, but many people with sleep apnea don’t snore at all. Waking up with a dry mouth, morning headaches, or persistent daytime exhaustion despite a full night in bed are all signs worth investigating. Sleep apnea is diagnosed through a sleep study, which can now often be done at home.

Other medical contributors include thyroid disorders (an overactive thyroid speeds up your metabolism and makes it hard to wind down), chronic pain conditions, acid reflux that worsens when lying flat, and medications for blood pressure, asthma, or depression that list insomnia as a side effect. If you started a new medication around the time your sleep worsened, that connection is worth raising with your prescriber.

When Poor Sleep Becomes Insomnia

Not all sleep trouble is insomnia. Clinically, insomnia is defined as difficulty falling asleep, staying asleep, or waking too early at least three nights per week for three months or longer, despite having adequate opportunity to sleep. The key distinction is that last part: if you’re only in bed for five hours because of a demanding schedule, the issue is insufficient sleep opportunity, not insomnia.

True insomnia often develops when short-term sleep disruption (from stress, illness, or travel) gets reinforced by behavioral patterns. You start dreading bedtime, spending extra time in bed trying to force sleep, or napping during the day to compensate. These coping strategies backfire, training your brain to associate the bed with wakefulness rather than sleep. The most effective treatment for chronic insomnia is a structured behavioral approach called CBT-I (cognitive behavioral therapy for insomnia), which works by breaking these associations and rebuilding your brain’s connection between bed and sleep. It outperforms sleep medications in long-term studies and typically takes four to eight sessions.

A Simple Starting Point

If you’re not sure where to begin, start with the factors that have the largest evidence behind them. Keep your bedroom at 65°F or cooler. Stop caffeine by noon. Avoid screens for at least an hour before bed. Go to sleep and wake up at the same time every day, including weekends. These four changes alone resolve a surprising number of sleep problems within one to two weeks. If they don’t, that’s useful information too, because it points toward a cause that’s physiological or psychological rather than environmental.