Anas bin Malik reported,

The people questioned the Prophet ﷺ so persistently that they wore him out with their questions. So one day the Prophet ﷺ ascended the pulpit and said, "Ask me about anything, and I will explain it to you."I began looking right and left, and there was every man wrapping his head in his garment, weeping. Then a man stood up who, whenever he was disputed with, used to be accused of not being his father's son. He said, "Prophet of Allah, who is my father?"He replied, "Your father is Hudhafah."Then Umar stood up and said, "We are pleased with Allah as Lord, with Islam as religion, and with Muhammad as Messenger. We seek refuge in Allah from the evil of trials."The Prophet ﷺ said, "I have never seen good and evil as I have seen them today. Paradise and Hell were depicted for me until I saw them right before the wall."Qatada used to mention this hadith in connection with the verse, "You who believe, do not ask about things which, if made clear to you, would distress you" [Maidah 5:101].

Bukhari 7089

Sahih

حدثنا معاذ بن فضالة حدثنا هشام عن قتادة

عن أنس رضي الله عنه قال

سألوا النبي ﷺ حتى أحفوه بالمسألة فصعد النبي ﷺ ذات يوم المنبر فقال لا تسألوني عن شيء إلا بينت لكم فجعلت أنظر يمينا وشمالا فإذا كل رجل لاف رأسه في ثوبه يبكي فأنشأ رجل كان إذا لاحى يدعى إلى غير أبيه فقال يا نبي الله من أبي فقال أبوك حذافة ثم أنشأ عمر فقال رضينا بالله ربا وبالإسلام دينا وبمحمد رسولا نعوذ بالله من سوء الفتن فقال النبي ﷺ ما رأيت في الخير والشر كاليوم قط إنه صورت لي الجنة والنار حتى رأيتهما دون الحائط فكان قتادة يذكر هذا الحديث عند هذه الآية {يا أيها الذين آمنوا لا تسألوا عن أشياء إن تبد لكم تسؤكم}

البخاري 7089صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tribulations
Chapter
Seeking refuge from trials
Numbering
Darussalam 7089
Bukhari 7089