Excommunication
Excommunication is an institutional act of religious censure used to deprive, suspend, or limit membership in a religious community or to restrict certain rights within it, in particular reception of the sacraments. Some Protestants use the term disfellowship instead.
The word excommunication means putting a specific individual or group out of communion. In some religions, excommunication includes spiritual condemnation of the member or group. Excommunication may involve banishment, shunning, and shaming, depending on the religion, the offense that caused excommunication, or the rules or norms of the religious community. The grave act is often revoked in response to sincere penance, which may be manifested through public recantation, sometimes through the Sacrament of Confession, piety, and/or through mortification of the flesh.
Christianity
In Matthew 18:15-17 Jesus says that an offended person should first draw the offender's fault to the offender's attention privately; then, if the offender refuses to listen, bring one or two others, that there may be more than a single witness to the charge; next, if the offender still refuses to listen, bring the matter before the church, and if the offender refuses to listen to the church, treat the offender as "a Gentile and a tax collector".