Yazid bin Thabit reported,

We went out with the Messenger of Allah ﷺ, and when we reached al-Baqi he came upon a fresh grave. He asked about it and was told it belonged to a certain woman. He recognized her and said, "Why did you not inform me about her?"They replied, "Messenger of Allah, you were taking your midday rest while fasting, so we disliked disturbing you."He said, "Do not do that. Whenever someone among you dies while I am present among you, inform me, for my prayer over the deceased is a mercy for them."Then he went to the grave, and we formed rows behind him, and he pronounced four takbirs over it.

Ahmad 19452

Sahih

حدثنا هشيم أخبرنا عثمان بن حكيم الأنصاري عن خارجة بن زيد

عن عمه يزيد بن ثابت قال

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

أحمد 19452صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Yazid bin Thabit
Numbering
Darussalam 19452
Ahmad 19452