Someone wanted to do evil, but first prayed as usual; and finding himself prevented by God, he was then extremely thankful.
When David wanted to kill Nabal the Carmelite, but was reminded of the divine retribution and abandoned his intention, he was extremely thankful. Again, we know what he did when he forgot God, and how he did not stop until Nathan the Prophet reminded him (cf. 1 Sam. 25; 2 Sam. 12).
At times when you remember God, increase your prayers, so that when you forget Him, the Lord may remind you.
Based on Saint Mark the Ascetic