(20) باب الأَمْرِ بِالْمَعْرُوفِ وَالنَّهْىِ عَنِ الْمُنْكَرِ
It was narrated from Abu 'Ubaidah that the Messenger of Allah (ﷺ)said:
"When the Children of Isral became deficient in religiouscommitment, a man would see his brother committing sin and would tellhim not to do it, but the next day, what he had seen him do did notprevent him from eating or drinking with him, or mixing with him. SoAllah made the hearts of those who did not commit sin like the heartsof those who did, and He revealed Qur'an concerning them and said:"Those among the Children of Israel who disbelieved were cursed bythe tongue of David and 'Eisa, son of Maryam" until he reached:"And had they believed in Allah, and in the Prophet and in what hasbeen revealed to him, never would they have taken them (thedisbelievers) as their friends; but many of them are disobedient (toAllah)."[5:78-81]The Messenger of Allah (ﷺ) sat up and said: "No, not until they take the hand of the wrongdoer (i.e. restrain him] and force him to follow the right way."
Reference: Sunan Ibn Majah 4006
In-book reference: Book 36, Hadith 81
English translation: Vol. 5, Book 36, Hadith 4006