Our psychological health affects our spiritual health. For example, if a person is suffering from a chemical imbalance in his brain that is causing depression, that will invariably have some negative effect on his ability to be grateful to Allah Almighty, which is a basic part of our worship. If a person fails to seek treatment for a psychological illness he is suffering from, then he could be accountable before Allah Almighty for the spiritual harm he suffered because of his neglect. If a person has a psychological disorder, he should seek treatment for the sake of both his physical and spiritual health. Hadrat Musleh Mau‘ud ra said:
Many spiritual illnesses are such as can be cured by doctors. A person who recites and understands the Holy Quran and tries his best to act on it, but despite this still commits certain evils, should consider that he may suffer from a physical illness which is often of a neural type. He should consult a doctor about his health, and although in our country, doctors pay little attention to curing neural illnesses, I expect that treatment to general neural weakness will often result in experiencing significant progress in spirituality. As a result, strength to avoid sin will develop in him and he will find the capacity within himself to control his emotions. However, remember that it is not necessary that one’s helplessness in abstaining from sin is always the result of a physical illness.
(Anwarul ‘Ulum, vol. 4, p. 363)