7 And lest haply he should seem to have given impunity for sins, in that he said, “He is faithful and just to cleanse us from all iniquity;” and men henceforth should say to themselves, Let us sin, let us do securely what we will, Christ purges us, is faithful and just, purges us from all iniquity: He takes from you an evil security, and puts in an useful fear. To your own hurt you would be secure; you must be solicitous. For “He is faithful and just to forgive us our sins,” provided you always displease yourself, and be changing until you be perfected.
Accordingly, what follows? “My little children, these things I write unto you, that you sin not.” But perchance sin overtakes us from our mortal life: what shall be done then? What? Shall there be now despair? Hear: “And if any man sin, we have an advocate with the Father, Jesus Christ the righteous: and He is the propitiator for our sins.” He then is the advocate; do your endeavor not to sin: if from the infirmity of this life sin shall overtake you, see to it straightway, straightway be displeased, straightway condemn it; and when you have condemned, you shall come assured unto the Judge.
There have you the advocate: fear not to lose your cause in your confession. For if oft-times in this life a man commits his cause to an eloquent tongue, and is not lost; you commit yourself to the Word, and shall you be lost? Cry, “We have an advocate with the Father.”
Source: Homilies on the First Epistle of John (New Advent)