In first few chapters of Confessions, St Augustine discussed how he struggled with lust
Aquinas also had 4 ways to overcome lust
Firstly , by fleeing the external occasions such as, for instance, bad company; and in fact whatever may be an occasion for this sin: “Do not gaze not upon a maiden lest her beauty be a stumbling-block to you… Do not look around you in the ways of the city, nor wander up and down in its streets. Turn away your face from a woman dressed up, and do not gaze upon another’s beauty. For many have perished by the beauty of a woman, whereby lust is enkindled as a fire” [Sir 9:5-9]. And again: “Can a man hide fire in his bosom, and his garments not burn?” [Prov 6:27]. And thus Lot was commanded to flee, “neither stay you in all the country about” [Gen 19:17].
The second way is by not giving an opening to thoughts which of themselves are the occasion of lustful desires. And this must be done by mortification of the flesh: “I chastise my body, and bring it into subjection” [1 Cor 9:27].
The third way is perseverance in prayer: “Unless the Lord build the house, they labor in vain who build it” [Ps 126:1]. And also: “I knew that I could not otherwise be continent, except God gave it” [Wis 8:21]. Again: “This kind is not cast out save by prayer and fasting” [Mt 17:20]. All this is not unlike to a fight between two persons, one of whom you desire to win, the other to lose. You must sustain the one and withdraw all support from the other. So also between the spirit and the flesh there is a continual combat. Now, if you wish the spirit to win, you must assist it by prayer, and likewise you must resist the flesh by such means as fasting; for by fasting the flesh is weakened.
The fourth way is to keep oneself busy with wholesome occupations: “Idleness hath taught much evil” [Sir 23:29]. Again: “This was the iniquity of Sodom your sister, pride, fullness of bread, and abundance, and the idleness of her” [Ez 16:49]. St. Jerome says: “Be always busy in doing something good, so that the devil may find you ever occupied.” Now, study of the Scriptures is the best of all occupations, as St. Jerome tells us: “Love to study the Scriptures and you will not love the vices of the flesh” [Ad Paulin.].
pintswithaquinas.com