Usama bin Zayd reported,

The daughter of the Prophet ﷺ sent word to him saying that a son of hers was dying and asking him to come to her. He sent back greetings of peace and said, "What Allah has taken belongs to Him, and what He has given belongs to Him, and everything has an appointed term with Him. So let her be patient and seek reward."She then sent word again, urging him by oath to come to her. So he set out, and with him were Saad bin Ubada, Muaz bin Jabal, Ubayy bin Kaab, Zayd bin Thabit, and some men.The child was lifted up to the Messenger of Allah ﷺ while his soul was rattling. I think he said, "as though it were a worn-out waterskin." His eyes then overflowed with tears.Saad said, "Messenger of Allah, what is this?"He replied, "This is mercy that Allah has placed in the hearts of His servants. Allah shows mercy only to those of His servants who are merciful."

Bukhari 1284

Sahih

حدثنا عبدان ومحمد قالا أخبرنا عبد الله أخبرنا عاصم بن سليمان عن أبي عثمان قال حدثني

أسامة بن زيد رضي الله عنهما قال

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

البخاري 1284صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Funerals
Chapter
Prophet's ﷺ saying, "The deceased is punished by some of the weeping of his family over him" if wailing was his practice
Numbering
Darussalam 1284
Bukhari 1284