I struggled with insomnia for a very long time and there are two things I'd recommend. The first is CBT, if your brain associates 'going to bed' with 'unbearable anxiety' - it will wake up the second you get into bed. I am still often reluctant to go to bed for this reason - I now won't get into bed until I'm absolutely exhausted.
Be gentle on your brain, it doesn't know your bed isn't dangerous. The limbic system isn't clever enough and the cortex isn't fast enough. You're falling down the gap.
The second is audiobooks playing on my phone (and nothing else). Find something so painfully dull that it'll hold your focus but won't tax your brain. I've listened to Middlemarch by George Elliot for about a year and I still can't tell you anything that has happened in the book. There may or may not be a vicar involved. Either way, classic dull literature is the way forward.
Giving my brain something to do without that thing actually being at all useful or interesting in any way did the trick. I still have occasional days of 4 and 5am if I've managed to get myself worked up about something, but those days are long behind me.
There are some excellent books out there - and if there's hope for this old Penguin, there's hope for your lovely self too. :o)