Surah Yusuf
وَلَقَدْ هَمَّتْ بِهِۦ ۖ وَهَمَّ بِهَا لَوْلَآ أَن رَّءَا بُرْهَـٰنَ رَبِّهِۦ ۚ كَذَٰلِكَ لِنَصْرِفَ عَنْهُ ٱلسُّوٓءَ وَٱلْفَحْشَآءَ ۚ إِنَّهُۥ مِنْ عِبَادِنَا ٱلْمُخْلَصِينَ
Wa laqad hammat bihī wa hamma bihā lau lā ar ra'ā burhāna rabbih(ī), każālika linaṣrifa ‘anhus-sū'a wal-faḥsyā'(a), innahū min ‘ibādinal-mukhlaṣīn(a).
And she certainly determined [to seduce] him, and he would have inclined to her had he not seen the proof of his Lord. And thus [it was] that We should avert from him evil and immorality. Indeed, he was of Our chosen servants.
📝 Footnotes
369) This verse does not imply that Prophet Joseph (peace be upon him) harbored an evil desire toward the woman; rather, it highlights that the temptation was so immense that had he not been strengthened by his faith in Allah Almighty, he would have surely fallen into sin.