I think Ambien is one of the safest medication out there IMO (as supposed to the other sleeping medications out there). You'll be able to securely guarantee anywhere b/w 6 to 8 hours of sleep.
A little addictive though, but use it when you really need the sleep. Perhaps use it to get the sleeping hygiene going first, get all the rituals before bed in placed and slowly decrease the reliance of it.
Also, try not to think about sleeping.
Avoid questioning or fearing whether or not you'll be getting enough sleep or be able to sleep or not. Totally ignore that, when your body feels tired + Ambien comes into play, your eyelids will feel heavier, your body will feel lighter and you'll just retire to bed like a baby.
Do not fear of sleep as the bed is harmless. Only you and your mind is killing your sleep.
Make sure that your bedroom is kept cool and strictly for sleeping only.
You want to be establishing a psychological association b/w 'bedroom' & 'sleep'.
Keep it abit shadey, cooler, with comfortable sheets and blankets - enough to generate warmth or lightly cover your body throughout the night.
Do all your office work, telephone work or paperwork outside of bedroom (if you have work desk in your bedroom).
Sleeping Ritual & Hygiene - Don't do activities that would otherwise excite or generate disruptions to the mind before retiring. You should be reading a novel that doesn't require you to think too much (for example I try to avoid any philosophical books prior to bedtime). Pick up a book that can be read like a breeze, ones that produces calming, soothing effects of your interests. "The Art of Happiness" by Dalai Lahma is a nice book I used to read.
Also, try not to eat right before bed time (despite the calorie + protein we need to endure the night), plan your meals prior so that your last meal contains a good deal of slowly ingested protein for the night. Before bed, you could also try to have a relaxing shower/bath to ease you up a little.
Also, jacking off right before bedtime is a 50-50 thing. For me, sometimes I am too aroused to sleep by it, other times it puts me to sleep effectively (without the Ambien).
So, j/o thoughtfully. (lol)
Hope I've been of some help.