I have trouble with insomnia. My doctors have prescribed xanac for me but I now feel like I cannot go to bed withoutthem and its giving me anxiety. What should I do?

Trouble. You have become physically defendant on it. There are ways to change this. Sleep issues are a very common problem, the root of which needs looked into. It's only after a thorough timeline and evaluation that your treatment will be as specific as possible. Depression, thyroid/adrenal/ and other possibilities need entertained. Please seek advice asap.
Talk to your doctor. Go to bed around the same time each night in a quiet dark comfortable bed. Be sure you have not been too stimulated just before bedtime, so don't eat, exercise, or work a few hours before you go to sleep. Since you are concerned about xanax, (alprazolam) it probably will make sense to taper off it under your doctor's supervision.
Sleep. So important, so hard to get. Sounds like you're hooked on Xanax (alprazolam) now. Talk with your doc. Lots of ways to ease off Xanax (alprazolam) gently & ease into other ways to snooze. Hope you're feeling better soon.
The anxiety you have. Now just thinking about having to go to bed without Xanax (alprazolam) is likely a psychological dependence on Xanax (alprazolam) to guarantee sleep for you. Physiologic dependence is less likely on a once daily Xanax (alprazolam) dose. Xanax (alprazolam) has such a short half life that when physiologically dependent withdrawal anxiety occurs within 5 or 6 hours after the last dose. Are you physiologically or psychologically dependent or both?