Not doing what I am currently doing...simultaneously watching T.V. and working on the computer at 2:45 a.m. I am a night owl, who has always suffered from insomnia (since age 12), but there are times it's really bad, and I do myself no favors by exercising hard after 8:00 p.m., watching TV, drinking that tasty, late night "fluffy" coffee, and working on the computer.
That said, much of the research on insomnia is finding that chemicals are missing in insomiacs' brains--the chemical that allows them to shut their brain off (sorry; too tired to look it up!). 6 years ago, I had insomnia so badly that I finally got on Ambien CR, which really helps (although not always). I went off of it for awhile, and ended up having an insomniatic bout that lasted for months, and ultimately, led me to having a full-out nervous breakdown. That was fun. I hope this info helps. I'm no doctor, but I've played a full-fledged expert in not sleeping for 30+ years. ;-)