I've had insomnia most of my life, so here's some tidbits I've learned over time.
First, make sure there's nothing inherently wrong with you that is stupidly obvious. For me, I have dealt with two separate issues in this regard. First, I was diagnosed as being hypothyroid while in college due to routine blood work. They over-medicated the crap out of me with Synthroid, causing me to be hyperthyroid for about eight months. During that time my mental health deteriorated as I was down to sleeping 1-2 hours a night, every night, for eight friggin' months before my doctor decided to retest me and adjust my Synthroid levels. So, get some basic blood work down just to make sure it's nothing obvious.
The other medical issue I had was leg cramping when I went to bed for about a decade. We thought it was "RLS" for a while, but in the end, after working with a PT for about four months, I discovered it was a structural back issue causing some sciatic nerve impingement. I learned a stretch that releases it and I've been able to keep it in check on my own and with occasional massages for over five years now.
Everything I've ever used loses effectiveness with time. Everything.
Benedryl is my number one go-to product, but it only works for four or five days in a row at best and if you don't take it early enough, it's a bear to wake up and you will be groggy. The way I use it now is after I've had a bad night, on the following night. Sorry to say, but sometimes you've just got to suck it up when you have a bad night and learn to function the best you can on the few hours you get. Taking anything after 10pm when you need to be up at 6am is a recipe for disaster. You'll only make your morning worse. Benedryl has about a 10-12 hour effect for me, so I try to take it before 8pm. The way I use it is if I suspect I'm not going to sleep (due to previous night or just work stress) and I take one at about 8pm. If I'm trying to make it through the rest of the work week, the second night I'll take two, the third and fourth night I'll take two, but then I either change drugs or ween myself off with one on the fifth night and nothing the sixth night.
My number two choice is Lunesta. It works great for me and has less of a hangover than benedryl, but I still need to take it by 9:30pm at the latest, preferably by 9pm. The one real downside is the nasty metallic aftertaste you get if you eat or drink anything but water after taking it. It will make watermelon taste like iron filings within 20 minutes of taking it. I usually save Lunesta for when I'm desperate for sleep and have a full eight or nine hours to commit to sleep. The problem is that if you take it for 3-4 nights in a row, you're screwed. At some point you'll have to go off of it and you can expect to be up half the night the first night off, but the next night returns to normal.
Along the same lines, I've used Ambien, but the original formula didn't get me through the night. I'd wake up after about five hours. I never tried the extended release formula, but I suspect it would work well.
I've used Melatonin and wasn't impressed. I didn't notice anything.
I used Valerian Root once and the hangover drowsiness the next day was hideous. I'd like to try it again from a different company or make my own, since it grows great in my garden. Let's just put it this way, the hangover was so bad that I haven't tried it a second time in over a year that the bottle has been in my medicine cabinet.
I've tried Tryptophan with uncertain results. I only used it once, borrowing it from a friend who got it from a compounding pharmacist. It seems to have worked, but having to get it from a compounding pharmacist or for that matter, even tracking down a compounding pharmacist seemed like too much effort.
Yes, a glass of wine or two in the evening works to get me to sleep, but if I'm really stressed I still wake up at 2-3am and can't get back to sleep.
Finally, I'm a sucker for a warm bath. Even if it means getting up a 3am and drawing a bath, soaking for a half hour while reading, and going back to bed, it is a hell of a lot better than feeling bad because I'm tossing and turning and worrying that I'm keeping my spouse awake.
Since joining my local volunteer fire department and being on call pretty much all the time, I've done my best to avoid all of the above as much as possible. Most of the time I find that I can function quite well on just one bad night; it's when it gets to be three or four in a row that I'm screwed and I stop functioning. That's when I'll resort to the benedryl or lunesta.