It was narrated from Abu ‘Ubaidah that the Messenger of Allah (ﷺ) said:
“When the Children of Isral became deficient in religious commitment, a man would see his brother committing sin and would tell him not to do it, but the next day, what he had seen him do did not prevent him from eating or drinking with him, or mixing with him. So Allah made the hearts of those who did not commit sin like the hearts of those who did, and He revealed Qur’an concerning them and said: “Those among the Children of Israel who disbelieved were cursed by the tongue of David and ‘Eisa, son of Maryam” until he reached: “And had they believed in Allah, and in the Prophet and in what has been revealed to him, never would they have taken them (the disbelievers) as their friends; but many of them are disobedient (to Allah).”[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.