Don 't stress yourself!
If you can't sleep don't stay in bed thinking "I have to sleep" again and again. Tell yourself "OK, right now the body is awake" and get up and do something. I tend to read a book (without too much action!) or knit or crochet. Then, after perhaps half an hour, I go to bed again. Most often that helps.
Insomnia happens in your head, too. So breaking this circle of "I have to sleep" - "I have to get up in X hours" - "Why can't I sleep" is the most important thing. Even if that half hour of knitting doesn't make me sleepy - it soothes the brain. And I got some more rows done :)