Part of one’s imaan is that we love for our fellow Muslim what we love for ourselves. This necessitates wanting good for for our fellow Muslim, and averting them from evil. So if we see someone doing something that is not allowed, it becomes obligatory for us to prevent it either verbally or physically. Similarly, we have to advise one another to good deeds if people are lax in performing them.
This obligation is one of the factors that has made our nation the greatest out of all of Allah’s nations.
“You are the best of peoples ever raised for mankind; you enjoin what is good and forbid what is evil, and believe in Allah.” (Surah Al-Imran:110)
As a result, leaving this obligation brings about Allah’s anger and punishment, and part of this punishment is that our du’as are not answered.
The Prophet, peace and blessings of Allah be upon him, said:
“I swear by Him in whose hands is my soul, you will of a surety command what is good, and forbid what is evil, or else it is very possible that Allah will send upon you His punishment, so you will make du’a to Him, and you will not be responded to.” (Recorded in al-Tirmidhi)