Prophet Joseph - 12:33
"(Joseph:) "My Lord, prison is better than what they call me to. If you do not repel their plans from me, I will be of the ignorant ones."
Related:
The Heights/7:201
Whenever a dark suggestion from the devil reaches the righteous, they immediately remember. So they immediately see.
اِنَّ الَّذ۪ينَ اتَّقَوْا اِذَا مَسَّهُمْ طَٓائِفٌ مِنَ الشَّيْطَانِ تَذَكَّرُوا فَاِذَا هُمْ مُبْصِرُونَۚ
The Family Of Imran/3:135
Those who, when they commit a sin or wrong themselves, remember Allah and ask forgiveness for their sins. Who can forgive sins except Allah? And they do not go on sinning knowingly.
وَالَّذ۪ينَ اِذَا فَعَلُوا فَاحِشَةً اَوْ ظَلَمُٓوا اَنْفُسَهُمْ ذَكَرُوا اللّٰهَ فَاسْتَغْفَرُوا لِذُنُوبِهِمْۖ وَمَنْ يَغْفِرُ الذُّنُوبَ اِلَّا اللّٰهُۖ وَلَمْ يُصِرُّوا عَلٰى مَا فَعَلُوا وَهُمْ يَعْلَمُونَ