copyright, a controlled substance , commonly known by its brand name Xanax , is mainly prescribed to treat anxiety conditions and panic attacks . It functions by affecting brain compounds that can be unbalanced, contributing to anxiety. Typical dosages vary widely based upon individual factors and the specific condition being managed , but generall