I used to have very bad insomnia when I was younger. I don't get it much any more, but every once in awhile, it hits me.
Usually it was because I couldn't settle my mind down. What helped was focusing on one thing away from whatever was on my mind. That could be music or radio talk shows. To this day, I go to sleep listening to podcasts.
When I still can't get to sleep, what often helps is moving to somewhere different. That could be something as simple as reversing my position and putting my head at the foot of the bed. Usually, it involves moving to somewhere else. Sometimes that is the couch or the floor. If that doesn't work, then I'll get up for 30-45 minutes and occupy some time.
Insomnia sucks.