Jesus had just been speaking about our relation to God as children. We are to be accepting of the hard to accept person (Matthew 18:1-5). We are not to get between God and His loved ones (Matthew 18:6-9). We should treat all believers with care, for they all matter, and God will go the distance to protect His children (Matthew 18:10-14).
Here we are given a procedure for protecting the assembly of His children, the local church. This is about a local setting, and of a limited scope. The more public sorts of sins and widespread damage are dealt with differently (cf. Titus 1:9-13). He isn’t speaking here of resolving differences of opinion, the Bible does that elsewhere (cf. Philippians 4:1-9). There may be wisdom in seeking to communicate with a person privately before doing so publicly, but this would be outside of this passage, not in obedience to it.
For this passage to apply, the sin must be serious enough to warrant expulsion and the situation such that the local church can take effective action. In our desire to do things rightly, we must be careful not to let the pendulum swing too far, from overly casual to overly critical. This isn’t about a person who falls down (Galatians 6:1). This is about a person who stands up in unrepentant, defiant rebellion, with major doctrinal, moral, or schismatic failures (cf. 1 Timothy 1:20 / 1 Corinthians 5 / Titus 3:10).
First, our goal is to warn the person privately and win Him back (James 5:19-20). If that fails, another attempt is made with extra people called for as a witness (2 Corinthians 13:1 / 1 Timothy 5:19). If that still fails, then the church must get involved. If the local body cannot reconcile with this person, if they remain unrepentant, then they are to be removed from the fellowship. The binding and loosing has to do with the disciplinary decisions being made. God vests a certain authority to the church; for the grossly unrepentant it is one, two, three, and you’re out.