The brain is central to sexual function. Chronic stress raises cortisol and keeps the body in a fight-or-flight state that suppresses arousal, while anxiety, especially performance anxiety, can directly interfere with getting or keeping an erection. Depression commonly reduces libido and pleasure, and the two often feed each other, with sexual problems worsening mood and low mood worsening sexual function.
Some treatments add complexity: certain antidepressants, particularly SSRIs, can reduce libido or delay ejaculation. This is manageable, but you should never stop prescribed medication abruptly; instead discuss alternatives with your doctor.
Addressing mental health often improves sexual health. See a doctor or use a telehealth service if stress, anxiety, or low mood are affecting your relationships or sexual function. Talking therapies, lifestyle changes, and, where appropriate, medication adjustments can help. Seek urgent support if you ever have thoughts of harming yourself by contacting a crisis line or your local emergency number.