It can help you pay attention, stay alert, and concentrate. It can also help you avoid impulsive and hyperactive behaviors. Xanax, on the other hand, is a drug called a benzodiazepine. It’s used to treat generalized anxiety disorder and panic disorder.