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:7:201

Indeed, those who fear Allah - when an impulse touches them from Satan, they remember ˹Him˺ and at once they have insight.  

Truly the God-fearing, when a visitation from Satan touches them, befalls them (tayfun: a variant reading has tā’ifun), that is, ˹when˺ something ˹of the sort˺ overcomes them, they remember, God’s punishment and His reward, and then see clearly, ˹distinguishing˺ the truth from what is other than it, and so they return ˹to God˺.
القرآن:٧:٢٠١

إِنَّ الَّذِينَ اتَّقَوْا إِذَا مَسَّهُمْ طَائِفٌ مِنَ الشَّيْطَانِ تَذَكَّرُوا فَإِذَا هُمْ مُبْصِرُونَ  

{إن الذين اتقوا إذا مسَّهم} أصابهم {طيفٌ} وفي قراءة طائف أي شيء ألَّم بهم {من الشيطان تذكَّروا} عقاب الله وثوابه {فإذا هم مبصرون} الحق من غيره فيرجعون.