Sunan Abi Dawud 5112
سنن أبي داود#5112SahihNarrated Abdullah ibn Abbas: A man came to the Prophet (ﷺ) and said: Messenger of Allah! one of us has thoughts of such nature that he would rather be reduced to charcoal than speak about them. He said: Allah is Most Great, Allah is Most Great, Allah is Most Great. Praise be to Allah Who has reduced the guile of the devil to evil prompting. Ibn Qudamah said "reduced his matter" instead of "reduced his guile". Ibn Qudamah said "reduced his matter" instead of "reduced his guile
Scholarly Authentication
We show the most cautious grade (weakest-wins) as the overall label. Individual scholars graded it as follows:
Al-AlbaniSahih
Muhammad Muhyi Al-Din Abdul HamidSahih
Zubair Ali ZaiIsnaad Sahih
In-book reference: 43:340