Remembrance of God and drawing near to Him - Section 3 Mishkat al-Masabih 2281

Arabic hadith text
وَعَنِ ابْنِ عَبَّاسٍ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «الشَّيْطَانُ جَاثِمٌ عَلَى قَلْبِ ابْنِ آدَمَ فَإِذَا ذَكَرَ اللَّهَ خَنَسَ وَإِذا غفَلَ وسوس» . رَوَاهُ البُخَارِيّ تَعْلِيقا
Translation

Ibn ‘Abbas reported God’s messenger as saying, “The devil is couching at the heart of the son of Adam. When he mentions God he withdraws, but when he is neglectful he makes evil suggestions.” Bukhari mentioned it in a note.