Treat Them as a Pagan or a Tax Collector
Richard Beck:
[Matthew 18.15-17] is one of those passages that has been use to support practices of exclusion and excommunication within the church. Specifically, if a fellow brother or sister is in sin and fails to repent at the encouragement of the church we are to "treat them as you would a pagan or a tax collector." That is, we are to shun them. ... The key ... is found in how Jesus interacted with "tax collectors and sinners." That is, it makes no sense to read Jesus as telling his followers to treat tax collectors and sinners like the Pharisees were treating tax collectors and sinners. (see Matthew 9.10-13a)
Context matters.