Prophet Joseph - 12:24
She lusted after him, and he would have lusted after her too had he not seen the sign of his Lord. So We turned away evil and mischief from him, and he was of Our pure servants.
The believers seek refuge in Allah when they are influenced by an evil thought:
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.
The Heights/7:200
Whenever an evil thought from Satan enters your mind, seek refuge in Allah; He is All-Hearing, All-Knowing.
The Heights/7:201
Whenever a dark suggestion from the devil reaches the righteous, they immediately remember. So they immediately see.
Prophet Joseph/12:23
"The woman in whose house he was wanted to seduce him, so he locked the doors and said: "I belong to you completely."He said: "I seek refuge in Allah. He is my Lord, who has given me a good place. The wrongdoers will not succeed."
Prophet Joseph/12:24
She lusted after him, and he would have lusted after her too had he not seen the sign of his Lord. So We turned away evil and mischief from him, and he was of Our pure servants.
The Dawn/113:1
"Say, "I seek refuge in the Lord of the dawn."
The Dawn/113:2
From the evil of what He has created.
The Dawn/113:3
From the evil of darkness when it descends.
The Dawn/113:4
From the evil of the interferers, the breakers of contracts.
The Dawn/113:5
From the evil of the jealous when he is jealous.
Mankind/114:1
"Say, "I seek refuge in the Lord of the people."
Mankind/114:2
To the ruler of the people,
Mankind/114:3
To the God of the people,
Mankind/114:4
whisperers of evil.
Mankind/114:5
They whisper in the breasts of the people.
Mankind/114:6
They are of the jinn and of the people.