Anoni has some very sharp points there; motivation is the key to sleep.
Prepare for slightly stupid advice;
I used to have a very similar problem, where I would spend all night trying to sleep, thinking about sleeping but I couldn't.
After a few years of this (possibly?) insomnia, I realised that it was because I was completely bored at night.
This sounds very very stupid, but I always imagine I'm a character in a story or something, then just go through with it in my mind, haha.
i m a g i n a t i o n.
If you get into a really good imagination-story, you may find yourself wanting to return to bed so you can continue imagining xD