Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:24:21

O you who have believed, do not follow the footsteps of Satan. And whoever follows the footsteps of Satan - indeed, he enjoins immorality and wrongdoing. And if not for the favor of Allah upon you and His mercy, not one of you would have been pure, ever, but Allah purifies whom He wills, and Allah is Hearing and Knowing.  

O you who believe, do not follow in the steps of Satan, that is, his ways of making things seem attractive. For whoever follows in the steps of Satan, assuredly he, the one being followed, enjoins indecency, that is, ˹he enjoins˺ vile acts, and what is reprehensible, if followed, according to the Law. And were it not for God’s bounty to you and His mercy not one of you, O band ˹of accusers˺, would ever have grown pure, after the calumny of which you spoke, that is to say, ˹not one of you˺ would have ever been reformed or purified from this sin by repenting of it. But God purifies whom He will, from sin, by accepting his repentance from him, and God is Hearer, of what you have said, Knower, of your intentions.
القرآن:٢٤:٢١

يَا أَيُّهَا الَّذِينَ آمَنُوا لَا تَتَّبِعُوا خُطُوَاتِ الشَّيْطَانِ ۚ وَمَنْ يَتَّبِعْ خُطُوَاتِ الشَّيْطَانِ فَإِنَّهُ يَأْمُرُ بِالْفَحْشَاءِ وَالْمُنْكَرِ ۚ وَلَوْلَا فَضْلُ اللَّهِ عَلَيْكُمْ وَرَحْمَتُهُ مَا زَكَىٰ مِنْكُمْ مِنْ أَحَدٍ أَبَدًا وَلَٰكِنَّ اللَّهَ يُزَكِّي مَنْ يَشَاءُ ۗ وَاللَّهُ سَمِيعٌ عَلِيمٌ  

{يا أيها الذين آمنوا لا تتبعوا خطوات الشيطان} أي طرق تزينه {ومن يتبع خطوات الشيطان فإنه} أي المتبع {يأمر بالفحشاء} أي القبيح {والمنكر} شرعاً باتباعها {ولولا فضل الله عليكم ورحمته ما زكى منكم} أيها العصبة بما قلتم من الإفك {من أحد أبداً} أي ما صلح وطهر من هذا الذنب بالتوبة منه {ولكن الله يزكي} يطهر {من يشاء} من الذنب بقبول توبته منه {والله سميع} بما قلتم {عليم} بما قصدتم.

See similar narrations below:

Collected by Ṭabarānī
tabarani:19616ʿAmr b. Abū al-Ṭāhir b. al-Sarḥ > Yaḥyá b. Bukayr > Ibn Lahīʿah > ʿAṭāʾ b. Dīnār

[Machine] On the authority of Sa'id ibn Jubayr: "O you who have believed, do not follow the footsteps of Satan" – meaning, "the adornment of Satan which led to the slander of Aisha" – "And whoever follows the footsteps of Satan" – meaning, "the adornment of Satan" – "indeed, he enjoins immorality" – meaning, "sins" – "and wrongdoing" – meaning, "that which is not known" – "and if it had not been for the favor of Allah upon you and His mercy" – meaning, "His blessing" – "not one of you would have been pure" – meaning, "none of you would have been righteous ever" – "but Allah purifies whom He wills" – meaning, "he rectifies whom He wills."  

الطبراني:١٩٦١٦حَدَّثَنَا عَمْرُو بْنُ أَبِي الطَّاهِرِ بْنِ السَّرْحِ ثنا يَحْيَى بْنُ بُكَيْرٍ ثنا ابْنُ لَهِيعَةَ عَنْ عَطَاءِ بْنِ دِينَارٍ

عَنْ سَعِيدِ بْنِ جُبَيْرٍ {يَا أَيُّهَا الَّذِينَ آمَنُوا لَا تَتَّبِعُوا خُطُوَاتِ الشَّيْطَانِ} يَعْنِي «تَزْيِينَ الشَّيْطَانِ حَتَّى قَذَفَ عَائِشَةَ» {وَمَنْ يَتَّبِعْ خُطُوَاتِ الشَّيْطَانِ} يَعْنِي «تَزْيِينَ الشَّيْطَانِ» {فَإِنَّهُ يَأْمُرُ بِالْفَحْشَاءِ} يَعْنِي «بِالْمَعَاصِيِ» {وَالْمُنْكَرِ} «مَا لَا يُعْرَفُ يَعْنِي مِثْلَ مَا قِيلَ لِعَائِشَةَ» {وَلَوْلَا فَضْلُ اللهِ عَلَيْكُمْ وَرَحْمَتُهُ} يَعْنِي «نِعْمَتَهُ» {مَا زَكَا مِنْكُمْ مِنْ أَحَدٍ} يَعْنِي «مَا صَلُحَ مِنْكُمْ مِنْ أَحَدٍ أَبَدًا» {وَلَكِنَّ اللهَ يُزَكِّي مَنْ يَشَاءُ} يَعْنِي «يُصْلِحُ مَنْ يَشَاءُ»