Firstly, your doctor will help you find whether there is a underlying condition causing your insomnia. If the underlying condition is treated, insomnia will no longer bother you.
If it does not improve your insomnia, you may accept the cognitive behavioral therapy (CBT). It tends to be more effective than medications.
CBT can help you decrease negative thoughts and movements that prevent you from sleeping. It includes stimulus control therapy, sleep restriction, light therapy, relaxation techniques, etc.
Key word: chronic insomnia treatment