Matthew 18: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.

18: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.

18: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 a publican.

18:18 Verily I say unto you, Whatsoever ye shall bind on earth shall be bound in heaven: and whatsoever ye shall loose on earth shall be loosed in heaven.

Jesus was teaching on the kingdom of heaven, and causing offences which would inhibit others from entering the kingdom.

The verses above are instructing them in how to deal with such offences.

If one would refuse the remedy provided for the offence on earth, the outcome would be bound in heaven, as well as on earth.

18:34 And his lord was wroth, and delivered him to the tormentors, till he should pay all that was due unto him.

18:35 So likewise shall my heavenly Father do also unto you, if ye from your hearts forgive not every one his brother their trespasses.

In these verses, Jesus was teaching them of the consequences of not forgiving those that offend.

Under the covenant with Israel, to be forgiven, they had to forgive.