There are several treatment options for short-term insomnia. If the cause of your insomnia is an underlying medical condition, a doctor might be able to treat the condition and get rid of the insomnia by doing so. If the cause is stress or anxiety, cognitive-behavioral therapy might help offer relief. Lifestyle changes such as keeping regular hours or not drinking caffeine may also help. Your doctor may also prescribe sleep medication.