I have very occasional episodes of sleeplessness that nothing will touch, no trick and no method of falling asleep.

But under normal circumstances when I'm just trying to pass the time I tell myself a story. Not an established fairy tale or anything and I don't talk to myself but I just kind of make something up as I go along. I try to focus on one scene at a time and add more and more detail until it's complete and then I drift off.