Anas bin Malik reported,

The Prophet ﷺ passed by a woman who was weeping at a grave and said to her, "Fear Allah and be patient."She replied, "Get away from me. You have not been struck by a calamity like mine."She did not recognize him. Then she was told, "That was the Messenger of Allah ﷺ."She went to the Prophet ﷺ and found no doorkeepers at his place. She said, "I did not recognize you."He said, "True patience is at the first shock."

Azami 3385

Sahih

عن أنس بن مالك، قال

مر النبي ﷺ بامرأة تبكي عند قبر فقال: اتقي الله واصبري. قالت: إليك عني، فإنك لم تصب بمصيبتي. ولم تعرفه. فقيل لها: إنه رسول الله ﷺ. فأتت النبي ﷺ فلم تجد عنده بوابين، فقالت: لم أعرفك. فقال: إنما الصبر عند الصدمة الأولى.

الأعظمي 3385صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Patience in tribulation and illness
Section
Patience in the face of calamity at the first shock
Numbering
Jami al-Kamil 3385 (2nd edition)
Azami 3385