I saw this in a sheet by the Fathers of Mercy:
If you have prayed at the time of temptation (i.e., precisely to help dispel the
temptation), you can be sure you did not commit a mortal sin.
This is pretty encouraging, but I was just wondering, is this absolutely true? We will never be in mortal sin if we just pray as soon as we see that we might sin?
Something similar to this, I found a quote by St Alphonsus against sins against purity:
It is well known-----and our Lady’s clients experience the fact every day-----that her great name gives that special strength which is needed to conquer temptations of the flesh. So St. Peter Chrysologus says that the name of Mary is an indication of chastity.
He meant that if some are worried whether they consented to impure thoughts, but remember that they invoked Mary’s name, they have a certain proof that they did not sin.