Alprazolam (Xanax) and temazepam (Restoril) are benzodiazepines, medications that help our nerve cells relax. Alprazolam is used to treat anxiety and panic disorder, while temazepam is used to treat insomnia, a condition that makes it difficult to sleep.