Medical help as described above is your answer to freedom. Once you get expert medical help and a good program going you'll be tapering for a very long time. Acceptance, patients, and continuing to seek support from others in the same boat, including us on this site, will get you through this with flying colors. You'll have withdrawal, but not as bad as "running out" like you just did! I think running out is a wake up call to how dependent we are to this stuff sometimes. A hidden blessing if you will.
I'm first hand experience here. I'm coming to the end of a very long Ambien taper program myself. Got about 3 weeks to go, been at it for 13 weeks now. I resolved to slowly, scientifically (with the help of my doctor), taper very patiently, a little bit at a time, never going backwards no matter what. And it's working!
It's doable my friend, very doable. I wish you the best in your quest for freedom.
2 to 3 mgs of xanax daily is a pretty hefty dose and so you shouldn't have attempted to go CT off of it. Check with your doctor asap to discuss this, you may be switched to a longer acting benzo like valium or klonopin which has a bit easier withdrawl than xanax. Good luck.
Coming off Xanax ideally should be done under Dr. Supervision, especially if you are taking Ambien too. It has to be done really slowly, and you'll probably have quite a few sleepless or difficult nights.
There's alot of good advice under the Health Pages Link. 5-HTTP, which is Tryptophan, and other Amino Acids and Vitamins can be very helpful.
There isn't any way to "wean off" and not feel side effects.
I was on a low dose of Xanax for awhile, and it took me 3 months to wean off it. I never abused it or took more than the dose prescribed for me, and I wasn't on it that long, but I'm very medication sensitive.
I wish you all the best.