I had a bad episode once. It got so bad that I was worrying about not being able to sleep. and that worry became a pounding in my chest that became a self fulfilling prophecy. urgh...
slept like 3 hours in 4 days. and nothing really worked, until i got so tired that i fell asleep... then that fear went away
But for milder episodes, try,
a) Benadryl, the one that makes you drowsy. My doc told me to try that as an alternative to real sleeping pills.
b)cereal or something that'll give you a sugar high (and that sugar low). hopefully you'll fall asleep during the sugar low.
c)count sheep? heh...
d) don't try to force yourself to sleep. If you can't fall asleep after an hour or so, wake up, read a book (better yet.. read a scientific journal), jerk off...etc... then go back to bed when you feel drowsy again.