Treatments for insomnia will often improve by making changes to your bedtime habits. If these don't help, your doctor may be able to recommend other treatments. If you've had insomnia for more than four weeks, your doctor may recommend cognitive and behavioural treatments or suggest a short course of prescription sleeping tablets as a temporary measure.