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.