Xanax, officially known as the drug, is a potent medication belonging to the class of drugs that’s often used to treat anxiety disorders and panic attacks . Healthcare professionals may prescribe it for conditions like generalized anxiety disorder, social anxiety disorder, and panic disorder. Typ