Amitriptyline is a tricyclic antidepressant commonly used to treat depression, anxiety disorders, and certain types of chronic pain, such as neuropathic pain and migraines. It works by increasing the levels of neurotransmitters, like serotonin and norepinephrine, in the brain, which helps improve mood and alleviate pain. Amitriptyline can also be prescribed for insomnia and to prevent migraines. However, it may cause side effects, including drowsiness, weight gain, and dry mouth.