I come from the orthodox hasidic Jewish community, which very enthusiastic about spirituality, and the spiritual importance of Jewish practice. Years ago I felt there was some grassroots view that if you were sufficiently spiritual and religious, you could not be mentally unwell.
But this view was not shared by the more informed members of the community who said that religious observance and spirituality were not, unfortunately, magic barriers against mental illness. In my research I found good liaison with mental health professionals.
In the community it's generally believed (I think correctly) that friendship (social support), many forms of prayer, and other activities (e.g. music) can be helpful.
There is some stigmatisation of mental illness and many members of the community are working hard to dispel this, with several organisations offering support and activities such as art, and home visiting, to those with mental illness.
I have been involved with such mental health support organisations for many years. I am an academic psychologist and have done a lot of research and writing and speaking on the general theme of the importance and indeed urgency of considering religious factors in all aspects of psychology. I have published many papers and three books on religion and mental health.
I am currently doing research on religious ritual and its effects, which has been unattended to scientifically for many years. I am writing several research articles and book chapters at the moment, including chapters for handbooks put out by the American Psychological Association. I am also working on a third edition of my popular introductory book on Psychometrics, and hoping to give papers and presentations on religion and mental health in Denmark, Sweden and Poland in the coming months.