It can be connected with different reasons so if your problem is really so bad and will last longer, it's better to talk with your doctor. On the other hand it can be an aftermath of a simple stress, in such case insomnia is temporary and can be easily treated with natural methods.
The most helpful among them are:
- creating a habbit of only sleeping on your bed, not doing anything else
- creating a fixed schedule for your bedtime and wake-up time
- controlling the amount of your sleep (it should be no less than 8 hours every night)
- making physical exercises during the day (it's very helpful for feeling more relaxed and reducing your stress hormones levels)
- using special relaxation techniques (like art-therapy or yoga)

Also in some cases insomnia can develop as an aftermath of hormonal imbalance, for example it's a common symptom of low human growth hormone https://www.hgha.com/list-diseases-caused-deficiency-growth-hormone, high cortisol, low progesterone and so on. That's why it's better to have a medical examination, tests and treatment because in this case the natural methods of treating insomnia aren't helpful.