We live in an overmedicated culture where popping a pill is often the first resort. Most people only know about pills when it comes to  treating insomnia. We hear about them from friends and see commercials on TV. Although medications can be helpful for insomnia, sleep specialists do not consider them to be the first-line, gold standard treatment for insomnia. That’s where cognitive behavior therapy for insomnia (CBT-I) comes in.

CBT-I is a non-drug treatment and has benefitted many types of patients who have trouble sleeping: from those with primary insomnia to others who can’t sleep due to chronic pain, depression or anxiety. CBT-I consistently produces results that are comparable to, or even exceed, those of sleeping pills! Even one year after ending treatment, many patients continue to sleep well (rates that far outperform sleeping pills).

READ MORE: Preparing Your Body and Room for Sleep

CBT-I isn’t as easy as just popping a pill every night. It takes effort and patients need to be motivated. Treatment generally lasts from 4-12 sessions, with many patients making gains within the first three sessions. The remaining sessions are typically used for medication tapering, if necessary, and relapse prevention.

Although it is ideal to not be taking any sleeping pills at the start, patients do not need to discontinue these medications in order to benefit from CBT-I. Many patients decide to start treatment while on medication and gradually taper off (with the help of their doctor) once they have learned alternative techniques for their insomnia.

The initial stressors that may have caused poor sleep may vary from patient to patient (e.g. divorce, job stress, health issues, etc.), insomnia is thought to be sustained by certain behaviors that many people adopt as sleep worsens. Examples of these behaviors include going to bed early, sleeping in, napping, using alcohol as a sedative, increasing caffeine use, worrying about the amount of sleep being obtained and tossing and turning in bed. CBT-I focuses on changing these behaviors. Although sleep hygiene can help some people sleep better, CBT-I is not simply sleep hygiene. It consists of various components that help target the various behaviors that maintain the problem.

Before the first session, you’ll typically be asked to track your sleep times (using a sleep diary) and sleep hygiene. Your clinician will review this in the first session. Sleep diaries are an important part of treatment and help guide progress over the weeks. You’ll also be taught about basic sleep hygiene. Examples of this include limiting caffeine and nicotine, avoiding evening alcohol and liquids, exercising 4-5 hours before bedtime, winding down before bed, limiting “screen time” within an hour of bed and avoiding heavy meals at night.Stimulus control is another key component. Insomnia patients spend increasingly more time in bed awake than asleep. They sometimes try to force sleep to happen by laying there. Others watch TV in bed, read in bed, or lay there worrying and/or thinking. As a result, the bed becomes associated not only with sleep, but also as a place to be awake. The rule is this: “The bed is only for sleep and sex. If you’re awake and thinking, get up, go to another room and do something until you’re sleepy again.” Although tough to do, it works really well.

Patients with insomnia tend to spend more time laying in bed than they are actually sleeping. With the help of your clinician and based on your sleep diaries, you will be asked to limit your time allowed in bed.  This technique, called sleep restriction, limits your time in bed and increases your body’s drive to sleep. As you sleep more soundly during the times you’re allowed in bed, your clinician will teach you how to gradually get more sleep.

READ MORE: Build Better Sleep Habits

Relaxation training is used to help those who are particularly tense at night. Not every patient needs relaxation training, but it can be quite powerful for those who do. There are many different relaxation techniques that can be helpful—from deep breathing to muscle relaxation to visualization. Find what works best for you.

The cognitive component of CBT-I teaches patients to recognize and modify inaccurate thoughts that affect your ability to sleep. For example, many patients have the thought “I must get eight hours of sleep or else I can’t function tomorrow.” This thought creates additional pressure to sleep, putting you in a tense and anxious state—one that does not induce sleep! Your clinician will teach you to challenge the evidence behind these thoughts and break the chain of anxiety that follows.

Clinicians who specialize in CBT-I are typically board certified in Behavioral Sleep Medicine. You can find a listing of these providers at the American Board of Sleep Medicine’s website . If you are unable to find someone in your area, contact your local sleep center to see if they provide these services or can recommend someone who does.

Self-help books offering CBT-I are also available. I highly recommend “The Insomnia Answer” by Paul Glovinsky and Art Spielman and “Quiet your Mind and Get to Sleep” by Colleen Carney and Rachel Manber.