25 Be quick to be favourable to your adversary while you are with him on the way (to court), lest he deliver you to the judge, and he to the officer, and you be thrown into prison.
26 In all sincerity I tell you that you will not come out of there until you pay back the last penny.
Jesus continued to teach His disciples some very practical advice. (His disciples were probably more than the twelve that He eventually chose).
The advice is that is at all possible avoid a court case.
Jesus warns His listeners that their best option is to settle things with their opponents before they get to court. In our words this is to settle out of court. In the days of Jesus this would avoid any financial penalty imposed by the court, and would bring the reconciliation that He spoke about in verses 23-24.
It may seem strange that Jesus talks about getting matters settled as the accusers and defenders were on their way to court. Yet in small communities this would not be an uncommon sight.
W Barclay makes the point that in Greek culture it was quite common for the accuser to arrest the person who had committed a crime against him. He would grab him by his robe at the throat in such a way that if his opponent struggled he would strangle himself. In this way the two would make their way to the court.
It is probable that such a custom may have infiltrated into Jewish ways.
However, Jesus was talking to a Jewish audience, and it is most likely that in a small town or village the accuser and defender would be making their way to court at the same time.
Jesus gives the advice that the defendant should use this opportunity to make peace with his accuser, and so avoid the penalty imposed by a court.
The advice of Jesus is similar to that written in the Old Testament:
[6:1] My child, if you co-sign a loan for a friend or guarantee the debt of someone you hardly know—
 if you have trapped yourself by your agreement and are caught by what you said—
 quick, get out of it if you possibly can! You have placed yourself at your friend’s mercy. Now swallow your pride; go and beg to have your name erased.
 Don’t put it off. Do it now! Don’t rest until you do.
 Save yourself like a deer escaping from a hunter, like a bird fleeing from a net – Proverbs 6.1-5 (NLT).
When we are in the wrong admit it sooner rather than later, and so be reconciled.