Mirtazapine is an atypical antidepressant primarily used to treat major depressive disorder by increasing serotonin and noradrenaline levels to improve mood. It is often prescribed for its sedative and appetite-stimulating effects, making it useful for treating insomnia and weight loss associated with depression.