The Prophet ﷺ entrusted to me the daughter of Umm Salama and said, "You are as one who nursed me."He stayed for as long as Allah willed, then came to him, and the Prophet asked, "What became of the girl?" or "the little girl?"He said, "I replied, 'She is with her mother.'"The Prophet asked, "Then what has brought you?"He said, "I answered, 'That you teach me what to say when I go to sleep.'"The Prophet said, "When you go to sleep, recite 'Say, you disbelievers' [Kafirun 109:1], then sleep upon its ending, for it is a declaration of freedom from shirk."
دفع إلي النبي ﷺ ابنة أم سلمة، وقال: إنما أنت ظئري قال: فمكث ما شاء الله، ثم أتيته، فقال: ما فعلت الجارية، أو الجويرية؟ قال: قلت: عند أمها، قال: فمجيء ما جئت؟ قال: قلت: تعلمني ما أقول عند منامي، فقال: اقرأ عند منامك {قل يا أيها الكافرون} قال: ثم نم على خاتمتها، فإنها براءة من الشرك.
Ahmad (23807), Tirmidhi (2403), and Hakim (1/565), who graded it sahih, all narrated it through multiple routes from Israel, from Abu Ishaq, from Farwa bin Nawfal Ashjai, from his father, who said, and then he mentioned it. The wording given here is that of Ahmad and Hakim, while Tirmidhi referred back to the hadith preceding it.Abu Dawud (5055) narrated it as well, and Ibn Hibban (790) and Hakim (2/538) graded it sahih, through multiple routes from Zuhayr bin Muawiya, from Abu Ishaq, with similar wording. Its chain is hasan because of Farwa bin Nawfal, since he is hasan al-hadith, and the discussion of this is elaborated at length in the book al-Azkar.It is said, concerning the reason for the revelation of this surah, that the disbelievers of Makkah asked the Prophet ﷺ that he worship their idols for a year while they worshiped his God for a year. So Allah revealed this surah, and commanded His Messenger to disavow their religion entirely. He said, "I do not worship what you worship, [2] nor do you worship what I worship" referring to the past, and "nor will I worship what you have worshiped, [4] nor will you worship what I worship" referring to the future. That is why he said, "For you is your religion, and for me is mine" [6] referring to the present, and we continue upon this except for one whose heart Allah opens to Islam, so he submits, worships what I worship, and abandons your idols.