Allah, the Wise, has said:
كُنْتُم خَيْرَ اُمَّهٍ اُخْرِجَت للنَّاسِ تَآمُرُونَ بِالْمَعْرُوفِ وَ تَنْهَونَ عَنِ الْمُنكَر
"You are the best group that has been brought forth for mankind: you enjoin goodness and you forbid the evil." 
Imam A'li (a.s.) said:
مَنْ تَرَكَ اِنْكاَرَ الْمُنْكَرِ بِقَلْبِهِ وَ يَدِهِ وَ لِساَنِهِ فَهُوَ مَيِّتٌ بَيْنَ الْاَحْياَء
"One, who refrains from prohibiting the evil by means of his heart, hand and tongue, is (like) a dead amongst the living." 
Anyone who seeks to enjoin the good and forbid the evil must himself be aware of what is lawful and unlawful, and should not act contrary to what he preaches.
His aim should be to guide the people. He should talk nicely and be aware of the difference in the level of understanding of the people. If he is opposed, he should exhibit patience and if supported and favoured, he should thank God.
1 - Bishr Haafi
Once, Imam Kadhim (a.s.) was passing by the house of Bishr Haafi, when he heard the sound of dance and music coming from inside.
At that very moment a slave-girl came out of the house to throw some garbage.
"Is the owner of this house a free person or a slave?" the Imam (a.s.) asked her.
The slave-girl replied, "He is a free man."
Hearing this, the Imam (a.s.) remarked, "You speak the truth, for had he been a slave, he would have feared his Master."
When the slave-girl came back inside the house, Bishr, who had been consuming wine, asked her what took her so long. As soon as the slave-girl related what had happened, Bishr immediately got up and ran bare-footed after the Imam (a.s.). Once he had caught up with the Imam, he expressed shame and repentance over his acts, sought forgiveness and amended his wrongful ways.
2 - Mulla Hasan Yazdi, the Forbidder of Evil
During the reign of Fath A'li Shah Qajaar, there lived in Yazd a scholar, by the name of Mulla Hasan Yazdi, who was held in high esteem by the people. The governor of the city of Yazd used to oppress the people and treat them with great cruelty. Mulla Hasan advised him to stop his evil deeds. When he refused to mend his ways, Mulla complained to Fath A'li Shah, but this too proved unproductive.
Since Mulla was particularly assiduous with respect to the issue of enjoining the good and forbidding the evil, he assembled the people of Yazd who, upon his orders, collectively threw the governor out of the city.
When Fath A'li Shah was informed of this incident, he was immensely upset and ordered Mulla Hasan Yazdi to be brought before him in Tehran.
As soon as Mulla came, Fath A'li Shah asked him about the incident in Yazd.
Mulla replied, "Your governor in Yazd was a tyrant and I wanted to relieve the people of his evils by throwing him out of Yazd."
The answer so enraged the Shah that he ordered Mulla’s legs to be tied.
Ameen-uddaulah said to the Shah, "He is not at fault. It was without his permission that the people threw out the governor."
In spite of his feet being fettered, Mulla Hasan spoke out:
"Why do we need to lie? I had the governor thrown out of Yazd because of his oppression."
Eventually, due to the intervention of Ameen-uddaulah, Mulla Hasan’s legs were untied.
That night, Shah witnessed the Holy Prophet (s.a.w.) in his dream and observed that two of his toes were tied.
"Why are your toes tied?" he asked the Holy Prophet.
The Holy Prophet (s.a.w.) replied, "It is you who has tied them."
Shah pointed out that he had never shown such disrespect.
The Holy Prophet (s.a.w.) explained, "But was it not you who had ordered Mulla Hasan Yazdi’s feet to be tied?"
Shah woke up from his sleep greatly alarmed. He ordered Mulla Hasan to be given resplendent clothes and to be returned to his city with great honour and respect. Mulla Hasan refused to accept the clothes and returned to Yazd. Later, he travelled to Kerbala and remained there for the rest of his life.
3 – God’s Command to Destroy City
God ordered two angels to destroy a city. On reaching there, the angels noticed one of the inhabitants beseeching and supplicating to God. One of the angels said to the other:
"Don’t you see this person supplicating?"
"Yes I do, but God’s order has to be executed," replied the other one.
"Wait. Let me ask God as to what should be done."
Praying to God, the first angel inquired: "In this city there is a person, who entreats and beseeches you. Do we still impose thechastisement upon the city?"
The answer came from God:
"Execute the commandment which has been given to you, for that person has never been perturbed and distressed for My sake, nor did he show anger over the evil deeds committed by the other people."
4 – Yunus Ibn A'bd al-Rahmaan
When Imam Kadhim (a.s.) departed from the world, his representatives had huge sums of wealth in their possession. As a result of their greed some of them began to deny the Imam’s death and thereby laid the foundation of a sect known as Waaqifiyyah. Ziyaad Qandi possessed seventy thousand gold coins while A'li Ibn Abi Hamzah had thirty thousand.
Meanwhile, Yunus Ibn A'bd al-Rahmaan invited the people towards the Imamate of Imam Ridha (peace be upon him) and regarded the Waaqifiyah sect as false and erroneous. When Ziyaad Qandi and A'li Ibn Abi Hamzah realised what Yunus was doing, they sent him a message asking:
"Why do you invite the people towards Imam Ridha (a.s.)? If your objective is to acquire riches, we will make you rich."
They pledged to give him ten thousand gold coins if he kept quiet and refrained from inviting the people towards the Imam (a.s.).
Yunus Ibn A'bd al-Rahmaan replied to them by quoting a narration from Imam Baqir (a.s.) and Imam Sadiq (a.s.), which says:
‘When innovations manifest themselves amongst the people, it is imperative for the elders and leaders to manifest what they know (so that people refrain from evil) and if they fail to do so, God shall take away from them, the light of faith.’ Under no circumstances shall I abandon jihad in the path of religion and the affairs of God."
After receiving this forthright and explicit reply from Yunus, Ziyaad Qandi and A'li Ibn Abi Hamzah became his enemies.
5 – The Caliph on the Rooftop!
One night, the second Caliph was surveying the streets to ascertain the general state of affairs in the city. In the course of his inspection, he happened to pass by a house from which he heard suspicious noises. He climbed over the wall of the house and looked inside. A man and a woman were sitting together, with a jar of wine placed before them.
Addressing them harshly he said, "You commit sins in solitude in the belief that God shall not make manifest your secret?"
The person turned to the Caliph and said, "Do not be so hasty, for if I have committed one sin, you have committed three. Firstly, God has said in the Qur'an: and do not spy. You have been doing just that. Secondly, He has said in the Qur'an: and go into the houses by their doors. You have entered from over the wall. Thirdly, He has said: So when you enter houses, greet your people with a salutation. You have not done so."
The Caliph asked, "If I were to pardon you, do you resolve to amend your ways?"
"By God! I shall never repeat this act again," the man replied.
The Caliph said, "Now you can be at ease, for I have pardoned you."
 Holy Qur'an, ch. Aale I’mraan (3), vs. 110.
 Jaame’ al-Sa’adaat, vol. 2, pg. 235.
 Darsi Az Akhlaaq, pg. 128; Minhaaj al-Karaamah (of A'llamah Hilli).
 Author of Muheej Al-Ahzaan.
 Hikaayat-ha-e-Shanidani, vol. 3, pg. 146; Qisas al-U’lema, pg. 101.
 Jaame’ al-Sa’adaat, vol. 2, pg. 231.
 Imam Ridha (peace be upon him) had said: Yunus Ibn A'bd al-Rahmaan, in his time, is as Salman Farsi was, in his own.
 Muntahal Aa’maal, vol. 2, pg. 253.
 Holy Qur'an, ch. Al-Hujaraat (49), vs. 12 (وَ لاَ تَجَسَّسُوا)
 Ibid, ch. Al-Baqarah (2), vs. 189 (وَ آْتُوا الْبُيُوتَ مِن اَبواَبِهَا)
 Ibid, ch. Al-Nur (24), vs. 61 (إِذاَ دَخَلتُم بُيُوتاً فَسَلِّمُوا)
 Pand-e-Taareekh, vol. 5, pg. 29; Al-Ghadeer, vol. 6, pg. 121.