CCC 2520 Baptism confers on its recipient the grace of purification from all sins. But the baptized must continue to struggle against concupiscence of the flesh and disordered desires. With God’s grace he will prevail
– by the virtue and gift of chastity, for chastity lets us love with upright and undivided heart;
– by purity of intention which consists in seeking the true end of man: with simplicity of vision, the baptized person seeks to find and to fulfill God’s will in everything;1
– by purity of vision, external and internal; by discipline of feelings and imagination; by refusing all complicity in impure thoughts that incline us to turn aside from the path of God’s commandments: “Appearance arouses yearning in fools”;2
– by prayer:
I thought that continence arose from one’s own powers, which I did not recognize in myself. I was foolish enough not to know. .. that no one can be continent unless you grant it. For you would surely have granted it if my inner groaning had reached your ears and I with firm faith had cast my cares on you.3

1 Cf. Rom 12:2; Col 1:10.
2 Wis 15:5.
3 St. Augustine, Conf. 6, 11, 20: PL 32, 729-730.