When it gets that bad?
I don't. I stay up, read books, clean house, weave rugs, organize stuff, play mmorpgs, write, paint; anything that'll occupy my mind until morning-time. Usually run on caffeine the next day (irritable and nervous as I get) and can sleep the following evening or night from exhaustion. Exercise can help, so long as it's two or more hours before bed.
Over-the-counter sleep aids always screwed me up more than they helped, but might be an option for some people.