Ambien will help you fall asleep, but it has a really short half life. If you're having trouble staying asleep, it probably won't do the trick.
Klonopin (clonazepam) is good if you can't stay asleep. It will allow you to sleep all night, but if not dosed correctly, you will feel a bit groggy the next day.
A few years ago, I had a really tough time with insomnia. I started with Ambien but was waking up at 4am and having to take another. Klonopin ended up doing the trick for me. It is by far the best sleep aid that I've ever taken. It let me feel rested without feeling "hungover" the next day (like the OTC stuff does to me).
They are both habit-forming, so I would try not to use them unless you have to. That being said, I remember how shitty I felt when I couldn't sleep. It can definitely sabotage the other parts of your life!
Sonny