Matthew 18:15-17
15 Moreover if thy brother shall trespass against thee, go and tell him his fault between thee and him alone: if he shall hear thee, thou hast gained thy brother.
16 But if he will not hear thee, then take with thee one or two more, that in the mouth of two or three witnesses every word may be established.
17 And if he shall neglect to hear them, tell it unto the church: but if he neglect to hear the church, let him be unto thee as an heathen man and
This answers your question but there are other verses too:
1 Corinthians 5:1-8 directs the church at Corinth to excommunicate a man for repeated sexual immorality (incest). In 2 Corinthians 5-11, the man, having repented and suffered the "punishment by the majority" is restored to the church. Fornication is not the only ground for excommunication, according to the apostle: in 5:11, Paul says, "I am writing to you not to associate with anyone who bears the name of brother if he is guilty of sexual immorality or greed, or is an idolater, reviler, drunkard, or swindler - not even to eat with such a one."
Romans 16:17
17 Now I beseech you, brethren, mark them which cause divisions and offenses contrary to the doctrine which ye have learned; and avoid them.
Also, in 2 John 1:10-11, the writer advises believers that "whosoever transgresseth, and abideth not in the doctrine of Christ, hath not God. He that abideth in the doctrine of Christ, he hath both the Father and the Son. If there come any unto you, and bring not this doctrine, receive him not into your house, neither bid him God speed: for he that biddeth him God speed is partaker of his evil deeds."