Question: A man from our city who adhered to the precepts of the religion suffered from a mental disorder . Some people said that he became sick because of the religion . And because of what he heard from the people , he shaved his beard and he no longer prays regularly. Is it permissible to say that he became sick because of his adherence to the regulations of the religion? And when a person says something like this, is he a disbeliever?
Answer: Adherence to the religion is not the cause of any sickness; rather, it is the cause of all that is good in this world and in the hereafter. It is not allowed for anyone to follow those who are foolish if they say things similar to this. It is not allowed for him to shave his beard, to trim it, or to stay away from prayer in congregation . It is incumbent upon him to remain steadfast upon the truth, and to stay away from all of what Allah prohibited him from and His Messenger (Sallallahu alayhi wa Sallam), and being wary of what angers Allah and causes His punishment , Allah Almighty said
"And whosoever obeys Allah and His Messenger will be admitted to Gardens under which rivers flow (in Paradise), to able therein, and that will be the great success. And whoever disobeys Allah and His Messenger , and transgresses His limits, He will cast him into the Fire, to abide therein; and he shall have a disgraceful torment."
He also said:
"Whoever fears Allah and keeps his duty to Him, He shall make a way for him to get out (from every difficulty). And He will provide him from (sources) he could never imagine.
"Whosoever fears Allah and keeps his duty to Him, He will make his matter easy for him."
As for the one who said that the illness, that struck him was because of his adherence to the
religion, then this person is ignorant. It is required to reprimand him and he must be taught that adherence to the religion only results in good, and that when a Muslim suffers from something that distresses him, this only means that his sins and mistakes are being atoned for. As for calling such a person a disbeliever ; this question requires a detailed answer to find this topic you can look at apostasy in the Books of Islam Jurisprudence.
Shaykh Ibn Baaz (Faraway Islamiyyah: 309/312