whether it pertains to Allah’s rights or to the rights of His servants. Therefore you must abandon insults, abusive language, murder, fraud, the unlawful consumption of wealth, undutifulness toward parents, the severing of family ties—in short, every matter Allah has forbidden. Even if your own soul urges you toward such things and presses you to commit them, remind yourself that Allah has prohibited them so that you may renounce them and keep well away.
The third category concerns shunning the perpetrator himself. At times the wrongdoer must be boycotted. The scholars state that a person who openly commits sin without any sense of shame may legitimately be shunned, provided that doing so brings about benefit. The benefit sought is that, once he is avoided, he realizes his condition and abandons the sin.
For example: a man known for cheating in buying and selling is boycotted by the people; when they do so, he repents, retracts, and feels remorse. Another man engages in usury; people shun him, do not greet him, and refuse to speak with him. When he notices this, he is embarrassed and returns to sound conduct. A third—and this is the gravest—does not pray at all. Such a person is an apostate disbeliever—may Allah protect us—who must be boycotted: his greeting is not returned, no one greets him, and no invitation of his is accepted until he recognizes his plight, turns back to Allah, and returns to Islam; only then will he benefit.
However, if boycotting brings no benefit and the matter concerns a sin short of disbelief—because in cases of disbelief the culprit is shunned regardless, and an apostate is boycotted in every circumstance, whether or not benefit ensues—then it is unlawful to boycott him. The Prophet, peace and blessings be upon him, said: “It is not permissible for a Muslim to forsake his brother for more than three nights; when they meet, each turns away from the other, and the better of the two…"