Trouble sleeping usually comes down to one of a few things: your brain is too alert, your body’s internal clock is off, or something in your environment or habits is interfering with the biological process that makes you drowsy. About 16% of adults worldwide have insomnia, and roughly half of those cases are severe. So if you’re staring at the ceiling wondering what’s wrong with you, you’re far from alone.
How Your Body Creates Sleep
Sleep isn’t just the absence of wakefulness. Your body actively builds the urge to sleep through two systems working together. The first is a chemical pressure that accumulates the longer you stay awake. A compound called adenosine builds up in your brain throughout the day, and the more it accumulates, the sleepier you feel. This is why pulling an all-nighter makes you feel progressively more exhausted: the pressure keeps rising with no release.
The second system is your circadian rhythm, your internal 24-hour clock. As evening approaches, your brain releases melatonin, which appears to promote sleep partly by amplifying that same adenosine signal. So the two systems reinforce each other: the chemical pressure says “you’ve been awake long enough” and the circadian clock says “it’s nighttime.” When either system gets disrupted, sleep becomes difficult or impossible.
Stress and Anxiety Are the Most Common Culprits
If your mind races the moment your head hits the pillow, that’s your stress response overriding your sleep drive. Anxiety and depression are among the most common causes of sleep problems. When you’re stressed, your body stays in a state of heightened alertness, producing cortisol and adrenaline that directly oppose the calming signals your brain needs to fall asleep. The cruel irony is that not sleeping makes anxiety worse, which makes sleep harder, creating a cycle that can be difficult to break on your own.
This isn’t limited to major life crises. Everyday worries, unresolved tasks, work pressure, or even vague unease can be enough to keep you awake. If you consistently find that your body feels tired but your mind won’t shut off, anxiety is the most likely explanation.
What You Drink Matters More Than You Think
Caffeine reduces deep sleep by an average of about 11 minutes per night and decreases its overall proportion in your sleep cycle. That might sound minor, but deep sleep is when your body does its most restorative work, and even small deficits add up over time. Caffeine has a long half-life, typically five to six hours, meaning half the caffeine from a 3 p.m. coffee is still circulating in your bloodstream at 9 p.m. If you’re sensitive to it, the effects can linger even longer.
Alcohol is trickier because it actually helps you fall asleep faster. The problem is what happens next. While alcohol increases deep sleep in the first half of the night, it causes a rebound effect in the second half: more frequent awakenings, suppressed dream sleep, and reduced sleep efficiency overall. With repeated use, alcohol disrupts sleep continuity, increases insomnia symptoms, and raises the risk of breathing problems during sleep. That nightcap might knock you out initially, but it’s likely the reason you’re wide awake at 3 a.m.
Screens and Light Exposure
Your circadian clock takes its strongest cue from light, especially blue light in the short-wavelength range around 464 nanometers. This is the type of light your phone, tablet, and laptop emit in abundance. Specialized cells in your eyes detect this light and use it to calibrate your internal clock. When those cells detect blue light at night, they suppress melatonin production, essentially telling your brain it’s still daytime.
Research shows that blue light significantly suppresses melatonin after about two hours of exposure, though the effects begin building before that. Scrolling through your phone in bed for 30 minutes won’t necessarily destroy your sleep, but two or three hours of screen time in the evening can meaningfully delay the point at which your body is ready for sleep.
Your Bedroom Setup
Temperature plays a surprisingly large role in sleep quality. Your core body temperature needs to drop slightly for sleep to begin, and a room that’s too warm fights this process. Most sleep experts recommend keeping your bedroom around 65°F (18.3°C). Humidity also matters: the EPA recommends indoor relative humidity between 30% and 50%, though some research suggests up to 60% is acceptable. Air that’s too dry irritates your airways and can cause congestion, while air that’s too humid promotes mold growth and can make the room feel stifling.
Noise and light are the other two environmental factors worth checking. Even low-level ambient light, like a streetlight through thin curtains or a standby LED on a device, can interfere with melatonin production. If you live in a noisy area, consistent background noise (a fan or white noise machine) tends to work better than earplugs for most people.
Medical Conditions That Disrupt Sleep
Sometimes the inability to sleep isn’t about habits or stress at all. Heart disease, lung conditions, chronic pain, and nerve disorders can all interfere with sleep. Medications for blood pressure, asthma, depression, and ADHD frequently cause insomnia as a side effect. If your sleep problems started around the same time you began a new medication, that connection is worth exploring.
Sleep apnea is another common and underdiagnosed condition. People with sleep apnea stop breathing briefly and repeatedly throughout the night, which fragments sleep without them necessarily realizing it. The result is waking up exhausted despite thinking you slept through the night. Snoring, gasping during sleep, and persistent daytime fatigue are the hallmark signs. Aging also changes sleep patterns naturally: older adults tend to sleep less, spend less time in deep sleep, and wake more easily.
When Sleeplessness Becomes Insomnia
A few bad nights don’t mean you have a sleep disorder. Clinical insomnia is defined by specific thresholds: the sleep difficulty has to occur at least three nights per week, persist for at least three months, and happen despite having adequate opportunity to sleep. That last part is important. If you’re only in bed for five hours because of your schedule, that’s sleep deprivation, not insomnia. Insomnia means you’re giving yourself enough time but your body or mind won’t cooperate.
If your sleep troubles meet those criteria, the gold-standard treatment isn’t medication. The American Academy of Sleep Medicine recommends cognitive behavioral therapy for insomnia (CBT-I) as the first-line approach. CBT-I combines techniques like stimulus control (only using your bed for sleep), sleep restriction (limiting time in bed to match the amount you’re actually sleeping), and cognitive strategies for managing the racing thoughts that keep you up. It’s typically delivered over four to eight sessions and has strong evidence behind it, often outperforming sleeping pills over the long term because the benefits persist after treatment ends.
Practical Changes That Help
If your sleep problems are relatively recent or mild, a few targeted changes can make a real difference. Cut off caffeine by early afternoon. If you drink alcohol, stop at least three to four hours before bed to give your body time to metabolize it. Dim the lights in your home in the hour or two before sleep, and if you use screens in the evening, enable night mode or blue-light filters.
Keep a consistent wake time, even on weekends. Your circadian clock relies on regularity, and sleeping in on Saturday morning can shift your internal clock enough to make Sunday night miserable. This is one of the most effective and most overlooked changes you can make.
Magnesium supplementation has modest evidence supporting its use as a sleep aid. Mayo Clinic experts suggest 250 to 500 milligrams of magnesium glycinate taken at bedtime as a gentle option. It’s not a powerful sedative, but for people who are mildly deficient in magnesium (which is common), it can take the edge off nighttime restlessness. Magnesium citrate has slightly more research behind it but tends to cause digestive issues.
If none of these changes help after a few weeks, or if you’re dealing with sleep problems that have persisted for months, the issue is likely deeper than habits alone. A structured approach like CBT-I, or an evaluation for an underlying medical condition, is the logical next step.

