I get it sometimes... usually when my mind's going a mile a minute for whatever reason... I've found the best way to combat it is to prepare your mind for rest.
My advice:
Exercise during the day a couple of times.
Don't eat a couple of hours before before you go to sleep.
Pour a single or double of whatever booze looks good about an hour before you go to sleep.
Groom yourself, and get into bed about 30 mins before your target bedtime with a book (best to read something more philosophical, educational, or light, and save those techno-thrillers or horror novels for when you're not having such a difficult time sleeping).
A couple chapters/30 mins later be sure to have finished your beverage, turn off the light, pull up the covers, and close your eyes.
Works for me 9 times out of 10... I'm out a few minutes later.
Feel free to mix in anything you consider soothing toward the end of the day... maybe an evening yoga class (counts as an exercise session), schedule a blowjob with your favorite lady-friend, or whatever.
If that doesn't work, try meditation.... several methods there.
But whatever you do, imho - stay away from sleeping pills.
