Trazodone is a prescription medicine to treat symptoms of depression, anxiety and/or insomnia. It is also used for pain relief and as an aid to opioid withdrawal treatment. Trazodone belongs to a class of drugs called tetracyclic antidepressant agents.