what do you do when you cant sleep?

Usually I tell the puppy to quit chewing on my toes...

Seriously, though, I don't really recommend TV, because it can actually mess with your ability to sleep. Books are better. Music is also good. Masturbation is actually a good suggestion as well because of the chemicals climax releases into your system. Excersise can help, but you usually won't "drop right off" afterwards. It takes like 30 minutes to "cool down", normally. Alchohol and drugs will put you to sleep, but it's not a "good" sleep, so not as restful. The big thing is, don't stress out over it. If you're not sleeping, either just relax and enjoy lazing about in bed, or get up and do something "quiet" until you do feel sleepy. Just laying there stressing over it is the single worst thing you can do.
 
Here's what works for me:

Since my job is the type of job that occurs mostly on the internet, I can do work from home if I need to. I rarely ever do, but I can always dig something up. I just get started on that, and before you know it, I'm bored out of my skull and tired.

I don't know how it works, it just does!
 
I tend to stay up till the early morning between 3 and 7 am anyway because I really like night time. It's weird but at night I prefer listening to music, playing guitar, watching films and everything else just because everyone else in the house or flat is asleep so I can concentrate on just the one thing.

This being said I'm usually tired as fuck by the time I want to go to bed so I, after a wank, I fall asleep within minutes!

If I wake up again I usually listen to stuff on my ipod, nearly always Death Metal.
 
nice question, great answers, well me as an insomniac, I have a great workout.
(It didn't help me, but it's worth a try ;))
First of all, get a great porno movie, tell your girlfriend you've got a great romantic movie, go for the scene where two lesbians shove anything up there uhm anything...
I guess you know what I mean. Now she might knock you out. If she didn't you might get REALLY lucky. And you won't care about sleeping.
Not helping, no girlfriend? alright, remember to buy or lend or download the movie. jerking, situps, jerking, pushups... Okay do that for three days, either you're gonna sleep or it's painful enough to go to an hospital. Some analgesics there and you're gonna sleep like my fat alcaholic father.
Seriously, go to a doctor, a psychiatrist. Sleeplessness was the first sign of my depression, and because I waited too long it got worse. The longer you wait to take this step, the harder it gets, the harder it gets, the longer it takes to get back to normal life.
If Insomnia is your biggest problem, ask for mirtazapine, it's an antidepressiva. From the first day I took it I could sleep. You might put on a little weight, but trust me. As soon as you can sleep regularily you won't mind. And it's not nearly that dangerous as valium and those things. There's no risk of getting addicted and the sleep is healthy and not numbed
 
Either take a PM or just get up.

If i'm sober I need music. Look at porn for 30 minutes,jerk off, lay in bed with headphones. You'll be out in less than 10 minutes probably.
 
Well, once I went for a short run while listening to Devin Townsend's 'Terria'. I went to sleep well after that. Since I've been drinking more (yes, I've even ordered a drinking horn -- can't drink mead from a glass!), I tend to sleep really well if I go to bed while I'm still drunk/buzzed, because you get that really heavy feeling all through your body and you're out in no time. Of course, I'm weird and sometimes I don't go right to sleep, and I'll end up reading a book (while still drunk). Speaking of reading, that helps, as others have said. And jacking off. You could even try just standing up for a little while. Sometimes, when you do that, you'll suddenly feel really tired, like it catches up with you.

So let's see: running, drinking, reading, jerking, standing. Those are my suggestions. If you manage to pull off all of those at once, I'm sure you'll sleep for days. Have fun!