Umm Salama bint Abu Umaya reported,

I heard the Messenger of Allah ﷺ say, "When you are present with a sick person or one who is dying, speak words of good, for the angels say 'amen' to whatever you say."She said, "When Abu Salama died, I asked, 'Messenger of Allah, what should I say?'"He replied, "Say, 'O Allah, forgive us and him, and grant me a good successor in his place.'"Ibn Numayr's version has, "a righteous successor."She said, "So Allah عز وجل granted me Muhammad ﷺ as a successor in his place."

Ahmad 26608

Sahih

حدثنا يحيى بن سعيد عن الأعمش قال حدثني شقيق وابن نمير قال حدثنا الأعمش عن شقيق

عن أم سلمة قالت

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

أحمد 26608صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Umm Salama
Numbering
Darussalam 26608
Ahmad 26608