Having a hard time to find sleep and get rest can be a nightmare (... sorry, pun unintended lol).
I don't know if that's an option for you, but i'd recommand that you talk to your family doctor about it.
That being said, there are some common things you can try, but of course it's important to take all your background and context into account here, so that's why talking to your doc could be important here.
Rituels are things you'll do everynight to "make your body ready to sleep". It's like giving it hints that you're about to go to sleep, so that it can begins to produce hormons and all that'll shut it down slowly.
Rituels could be to drink some infusion for the night (with herbs that relax, like chamomil, verbena..), reading a book, etc.
The best way to set your "clock" right is to get back some regularity in your schedule : going to sleep around the same time every night (before midnight), having dinner at the same time every night, waking up around the same time etc.
3) Hygiene of life stuffs
Some things help also a lot to get back to your sleeping rythm :
- avoiding screens (blue light) on the evening (if you neeeeed to watch a tv show before going to bed, then you can find softwares for your computer to adapt day light (and avoid blue light at night, which prevent your brain to "stay awake" because of blue light. Try f.lux, it changed my life, really !)
- having a light dinner (digestion doesn't help to sleep if you ate too much)
- avoiding exciting stuffs before going to bed, like cafeine (or tea !), sport etc
- well hum, making love helps too to find sleep lol but that shouldn't be your only motivation to have sex of course haha ^^" sorry if it was innapropriate, just thought it could be worth stating lol
- doing relaxing stuffs, like meditation, soft yoga, relaxation etc
If those changes of behaviour don't work, there are other things, like melatonin (the sleep hormon), if you have a hormon unbalanced or smth like that, so that's why going to your doc could help you better ^^
Insomnia can be a real pain in the .. bottom, but it's not a fatality, and I honestly hope that you'll find what works for you to find some rest... I wish you the best !