The Messenger of Allah ﷺ said, "Satan comes to one of you and asks, 'Who created such-and-such? Who created such-and-such?' until he says, 'Who created your Lord?' When it reaches that point, let him seek refuge with Allah and stop."
قال رسول الله ﷺ: يأتي الشيطان أحدكم فيقول: من خلق كذا؟ من خلق كذا؟ حتى يقول: من خلق ربك؟ فإذا بلغ ذلك، فليستعذ بالله، ولينته.
Bukhari narrated it in the Book of the Beginning of Creation (3276), and Muslim in the Book of Faith (134:214), both through Layth bin Saad, who said, Aqeel bin Khalid narrated to me, he said, Ibn Shihab said, Urwa bin Zubayr informed me that Abu Hurairah said, then he mentioned it.Muslim also narrated it through another route from Abu Hurairah, who said, the Messenger of Allah ﷺ said, "People will keep asking questions until it is said, this, Allah created creation, but who created Allah? Whoever encounters anything of that should say, I believe in Allah and His messengers."Abu Dawud (4722) and Nasai in Al-Kubra (4722) both narrated it through Muhammad bin Ishaq, who said, Utba bin Muslim, the freed slave of Banu Taym, narrated to me, from Abu Salama bin Abdul-Rahman, from Abu Hurairah, who said, and he mentioned something similar, saying, "So when they say that, say, "Allah is One. Allah the Self-Sufficient Master. He begets not, nor is He begotten. And there is none comparable to Him" [Ikhlas 112:1–4], then let him spit to his left three times and seek refuge from Satan."Its chain is hasan because of Muhammad bin Ishaq, and he has explicitly stated that he heard it directly.