Assalaamu alaiyum, shaykh. I suffered from a strange condition of anxiety that makes my body smell so bad that I cannot go to a mosque or any other place because of this. This problem has made me antisocial. My question is: how do I relieve myself from this anxiety that causes this body odor according to Islam, and what about praying in the mosque? Do I have an excuse not to pray in the mosque until this problem is cured?
All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
If this bad smell that is emitted from you harms the worshipers, then you are excused from the obligation of praying in congregation.
Kash-shaaf Al-Qinaa’ reads, "What takes the ruling as garlic and onions and the like is passing wind and emitting a (bad) smell from one's mouth in the mosque, because the smell harms, so it is permissible to protect the mosque from this, and a person is taken out of the mosque because of this.”
Shaykh Ibn 'Uthaymeen said, "If a person has a stinking smell in his mouth or nose, or the like, which harms the worshipers, then he does not attend the mosque as a way of repelling his harm.”
So if you do not attend the congregation in the mosque because of your bad smell, then Allah will reward you for your intention. However, if Allah cures you from this condition, then you must attend the congregation and pray in the mosques.
As regards the anxiety that you suffer from, then you should remember that this is a test from Allah, and you will be rewarded for being patient with it. Also, you should think about the great wisdom that Allah has in everything that He Predestines and Decrees. Please, refer to fatwa 83577.
We ask Allah to cure you.
Allah knows best.
You can search for fatwa through many choices