Amitriptyline is a tricyclic antidepressant primarily used to treat major depressive disorder, anxiety disorders, and certain chronic pain conditions. It works by increasing the levels of neurotransmitters like serotonin and norepinephrine in the brain, which helps improve mood and alleviate pain.