Currently, the most effective of these is called cognitive behavioral therapy for insomnia, or CBT-I, and it is rapidly being embraced by the medical community as the first-line treatment. Working with a therapist for several weeks, patients are provided with a bespoke set of techniques intended to break bad sleep habits and address anxieties that have been inhibiting sleep.