Cognitive behavioral therapy for insomnia may be a good treatment choice if you have long-term sleep problems, you're worried about becoming dependent on sleep medications, or if medications aren't effective or cause bothersome side effects.