There are quite a number of medical conditions that can produce insomnia. But insomnia related to anxiety can be resolved 80+ percent of the time. When you have a close look, it becomes apparent that the anxiety about having insomnia comprises most of the anxiety. When your head hits the pillow, the worry that you might not get enough good sleep keeps just enough current flowing through the brain’s awake system to prevent the sleep system from clocking in. I use cognitive behavioral strategies and hypnosis, and also pay a lot of attention to my client’s daily routines, to tweak here and there for optimal nighttime sleep readiness, and to relieve insomnia.

sleep is the best meditation.
Dalai Lama
Insomnia is a gross feeder. It will nourish itself on any kind of thinking, including thinking about not thinking.
Clifton Fadiman