I've had sleep problems for DECADES. My brain just wouldn't shut off at night. I didn't just stare at the wall trying to sleep. Instead, my brain was always "on", ruminating about that day, planning the next day, wondering about things in general, round and round it would go. I tried the natural route : melatonin (gave me horrendous nightmares), no coffee after 12noon, then none after 10am, no soda period, light exercise, no exercise in the evening, meditation (couldn't do it for same reason I couldn't sleep), etc. I would fall asleep exhausted around 4am, and drag myself through the next day. The next night I would be so exhausted that I would get to sleep around 1 or 2am instead of 4 or 5.
I was diagnosed with depression and anxiety and given klonopin and trazadone. The klonopin relaxed me and the trazadone put me to sleep - sometimes. I would find myself waiting for that "woozy" feeling (which I didn't like), and then I'd have to cut short everything I was doing and practically run for the bed before the "window" closed and I got a second wind. And I would still wake up after a few hours.
Then I was diagnosed with Bipolar 2 (Depression dominant), and it was explained to me that insomnia can be part of the manic side of bipolar. Boy, did a lot of things click into place! I had always thought mania was "floating on top of the world", grandiose thinking, rapid-fire speech, reckless spending, etc, none of which I do. I started taking a mood-stabilizer (Geodon) combined with mirtazapine (for sleep), and I get the most gorgeous sleep now! I just find myself getting relaxed and slowing down, without the wooziness, and I leisurely get ready for bed. It's amazing the difference the two drugs have made.
Anyway, if your insomnia is due to your brain not wanting to "turn off", consider it might be a sign of mania. Irritability is also a sign of mania. I'd always chalked up my irritability to my lack of sleep, but it's actually a symptom in its own right, of mania.
For the record, I had to request a mood-stabilizer. No one had even considered bipolar until I did the research and presented them with the idea of it. Then I got some feedback and me and the pdoc gained so much clarity into why I wasn't sleeping.
Just throwing this out there for everyone who's tried every sleeping pill out there - you might benefit from a mood-stabilizer. They aren't all scary (like Lithium has such a bad reputation). My Geodon is weight-neutral and I feel so much more "smoothed out". Not a zombie (like Seroquel made me feel).
Hope this helps someone!