Narrated Anas:
The Prophet (ﷺ) delivered a sermon the like of which I had never heard before. He said, "If you but knew what I know then you would have laughed little and wept much." On hearing that, the companions of the Prophet (ﷺ) covered their faces and the sound of their weeping was heard. A man said, "Who is my father?" The Prophet (ﷺ) said, "So-and-so." So this Verse was revealed: "Ask not about things which, if made plain to you, may cause you trouble." (5.101)
USC-MSA web (English) reference: Vol. 6, Book 60, Hadith 145
Arabic reference: Book 65, Hadith 4621