It depends on what kind of sleeping issues you have. If you have trouble falling asleep, clonodine. If you have trouble falling asleep and staying asleep, trazodone, lunesta. If you can fall asleep but wake up with racing thoughts, unable to go back to sleep, Ativan.
I personally have taken several prescribed sleep meds. They usually don't start you on something like lunesta. Ambien is meant to be a short term drug, maybe 1-2 months. Trazodone is one of the first I took. After so long, I started getting restless leg from it. My Dr switched me lunesta and I worked my way up to 3mg. I also take Clonazepam, methocarbamol, duloxetine, and candesartin (blood pressure) all when I'm going to sleep. I have a diagnosed sleep disorder though.
Your Dr may want you to do a sleep study before putting you on any heavy stuff to help you sleep. Have you ever had one? A lot of people don't realize that insomnia is just one piece of things like narcolepsy, idiopathic hypersomnia. They have an entirely different set of drugs for that.