The disciples had come to Jesus to ask him who was greatest in the kingdom of God, but Jesus helped them to understand just how little they actually understood and how the kingdom worked. He said that they must become like a little child, and they must not cause that child to stumble or lose being part of the kingdom, or else they themselves would be severely punished.
Jesus explained that his Father does not want anyone to be lost, neither they, the disciples, nor any other person. He wants everyone to be saved, and so we must do everything that we can to bring people into connection with him.
Jesus said that the way in which we must do this is to go to the people who are sinning. Speak to them directly, pointing out their fault just between the two of you. Hopefully they will listen and you will have won them over, having won them back into the kingdom.
But if not, then try again. Take a couple of witnesses to talk with them. Hopefully they will listen.
But if not, try yet again! Take them and go before the entire church, the whole community of believers.
But still, if they won’t listen, at that point, you must put the person out of the community.
If your brother or sister sins, go and point out their fault, just between the two of you. If they listen to you, you have won them over. But if they will not listen, take one or two others along, so that ‘every matter may be established by the testimony of two or three witnesses.’ If they still refuse to listen, tell it to the church; and if they refuse to listen even to the church, treat them as you would a pagan or a tax collector.
Matthew 18:15-17
This is, of course, a very simple methodology prescribed by Jesus to confront people in their their sin. First to the person directly, then with witnesses, and then finally before the entire church community. In this way, the person can understand their sin and be held to account for it by many people. The point, of course, is not merely to hold the person to account, but instead that they would be won over. We desire that we would have the same desires that God would have, that none would be lost and that each can be won over and be brought back into the kingdom of God.