Phenelzine works by inhibiting the activity of monoamine oxidase, an enzyme responsible for breaking down neurotransmitters such as serotonin, norepinephrine, and dopamine. By preventing the breakdown of these chemicals, phenelzine increases their availability in the brain, which can help alleviate symptoms of depression and anxiety.