Xanax, generically known as alprazolam, is a prescription medication primarily used to treat anxiety and panic disorders. It belongs to a class of medications called benzodiazepines, which work by enhancing the effects of a neurotransmitter called gamma-aminobutyric acid (GABA) in the brain, producing a calming effect.