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.