Having issued a warning against giving "offense" (cf. Matt. 18:7), Jesus now explains how to act when an offense is received from a brother. He is to personally be made aware of his sin against you, though your purpose in so doing is not to humiliate him but to gain him back as a faithful brother. Thus, the offended is to seek the offender and the offender is likewise to seek the offended (cf. 5:23,24). Neither is to wait for the other one to approach! God is interested in peace and unity; it makes no difference to Him as to who makes the first move (though both parties clearly have a responsibility in such a matter). The offended is not to brood over his mistreatment and develop hatred toward the offender. He is not to tell others of his brother's sin unless such becomes necessary (cf. 18:16). The offended is to go to his brother in the spirit of meekness (cf. Gal. 6:1) and seek his repentance.
"But if he will not hear, take with you one or two more" (Matt. 18:16). The design of taking these witnesses is likely twofold: (1) The offender might be led to repentance when he sees that several people of a serious character and candid judgment are condemning his fault, and (2) These witnesses can later testify before the church if such becomes necessary (cf. 18:17; Deut. 17:6; 19:15).
"And if he refuses to hear them, tell it to the church" (Matt. 18:17). Only as a last resort is the knowledge of the sin to be made public to the church (i.e., assembly), and even then the purpose is so the entire congregation can put forth its best effort to restore the erring brother.
"But if he refuses even to hear the church, let him be to you like a heathen and a tax collector" - If the brother still refuses to repent, there is nothing left to do but to withdraw fellowship from him (i.e., sever social interaction with him) so that he will understand the seriousness of his actions and that he will continually be reminded of his need to repent. In such circumstances the individual should not be treated spitefully or as an enemy, but all future contact with him should be exclusively limited to exhortations of repentance (cf. I Cor. 5; II Thess. 3). To continue having fellowship with brethren who are in need of repentance sends the message to them that we approve of their actions and don't believe they've done anything wrong. It also tells God that we think we know better than Him as to how sin should be dealt with in His church. Since He clearly wants sin to be removed from the body of Christ (cf. I Cor. 5:7), then what right do we have to ignore it and let it remain?
It is interesting to note that the "church" is mentioned here by Jesus before it literally came into existence. His instructions on this occasion were preparatory and given in anticipation of the church for which He knew would soon be established. Also, a few general observations on responsibility are in order: (1) every Christian is responsible for his brother, (2) the entire church is responsible for each Christian, and (3) each Christian is answerable to the church.
Jesus continued in Matthew 18:18-20 - "Assuredly, I say to you, whatever you bind on earth will be bound in heaven, and whatever you loose on earth will be loosed in heaven. Again I say to you that if two of you agree on earth concerning anything that they ask, it will be done for them by My Father in heaven. For where two or three are gathered together in My name, I am there in the midst of them."
The Greek tenses here indicate that whatever is "bound" or "loosed" on earth has already been "bound" or "loosed" in heaven (cf. Matt. 16:19). Thus, in this context, if an offender is withdrawn from by the church (i.e., "bound" = the discipline has been administered), then it should be understood that God has already withdrawn His fellowship from that individual. Likewise, when an offender comes to repentance and is no longer outside the fellowship of the church (i.e., "loosed" = the discipline inflicted by the church has ceased), it should be understood that he has also already been restored to a proper fellowship with God. Matthew 18:19 seems to reiterate the meaning of verse 18, only with different words.
The emphasis in this context is not that two or three must be gathered in order for the Lord to be present (cf. Matt. 28:20). The idea is that when two or three (cf. 18:16) are practicing proper discipline, they do so with His authority (i.e., He is there with them, validating the entire discipline procedure).