Surah Yusuf (يوسف) · verse 24 (Meccan · Juz 12 · page 238)
وَلَقَدْ هَمَّتْ بِهِۦ وَهَمَّ بِهَا لَوْلَآ أَن رَّءَا بُرْهَٰنَ رَبِّهِۦ كَذَٰلِكَ لِنَصْرِفَ عَنْهُ ٱلسُّوٓءَ وَٱلْفَحْشَآءَ إِنَّهُۥ مِنْ عِبَادِنَا ٱلْمُخْلَصِينَ ﴿24﴾
التفسير الميسر
ولقد مالت نفسها لفعل الفاحشة، وحدَّثت يوسفَ نفسُه حديث خطرات للاستجابة، لولا أن رأى آية من آيات ربه تزجره عمَّا حدثته به نفسه، وإنما أريناه ذلك؛ لندفع عنه السوء والفاحشة في جميع أموره، إنه من عبادنا المطهرين المصطفَين للرسالة الذين أخلصوا في عبادتهم لله وتوحيده
Sahih International
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
Marmaduke Pickthall
She verily desired him, and he would have desired her if it had not been that he saw the argument of his Lord. Thus it was, that We might ward off from him evil and lewdness. Lo! he was of Our chosen slaves
Abdullah Yusuf Ali
And (with passion) did she desire him, and he would have desired her, but that he saw the evidence of his Lord: thus (did We order) that We might turn away from him (all) evil and shameful deeds: for he was one of Our servants, sincere and purified