Umm Salama bint Abu Umaya reported,

The Messenger of Allah ﷺ said, "No one is struck by a calamity and says, as Allah has commanded, 'Indeed, we belong to Allah, and indeed to Him we shall return' [Baqarah 2:156], 'O Allah, reward me in my calamity and grant me something better in its place,' except that Allah does that for him."Umm Salama said, "When Abu Salama died, I said those words. Then I said, 'Who could be better than Abu Salama?' But Allah granted me in his place the Messenger of Allah ﷺ, who married me."In another narration, "No Muslim is struck by a calamity and says what Allah has commanded him to say, 'Indeed, we belong to Allah, and indeed to Him we shall return' [Baqarah 2:156], 'O Allah, reward me in my calamity and grant me a replacement better than it,' except that Allah grants him something better in its place."She said, "When Abu Salama died, I said, 'Which of the Muslims is better than Abu Salama? His was the first household to emigrate to the Messenger of Allah ﷺ.' Then I said those words, and Allah granted me in his place the Messenger of Allah ﷺ."She said, "The Messenger of Allah ﷺ sent Hatib bin Abu Balta to me to propose marriage on his behalf. I said, 'I have a daughter, and I am a jealous woman.'He replied, 'As for her daughter, we will pray to Allah to make her independent of her, and I will pray to Allah to remove the jealousy.'"

Azami 3386

Sahih

عن أم سلمة زوج النبي ﷺ

و أن رسول الله ﷺ قال: من أصابته مصيبة فقال كما أمر الله: {إنا لله وإنا إليه راجعون}. اللهم أجرني في مصيبتي، وأعقبني خيرا منها. إلا فعل الله ذلك به. قالت أم سلمة: فلما توفي أبو سلمة، قلت ذلك. ثم قلت: ومن خير من أبي سلمة؟ فأعقبها الله رسول الله ﷺ فتزوجها. وفي رواية: ما من مسلم تصيبه مصيبة فيقول ما أمره الله به: {إنا لله وإنا إليه راجعون} اللهم أجرني في مصيبتي، وأخلف لي خيرا منها، إلا خلف الله له خيرا منها. قالت: فلما مات أبو سلمة قلت: أي المسلمين خير من أبي سلمة؟ أول بيت هاجر إلى رسول الله ﷺ. ثم إني قلتها. فأخلف الله لي رسول الله ﷺ. قالت: أرسل إلي رسول الله ﷺ حاطب بن أبي بلتعة يخطبني له. فقلت: إن لي بنتا وأنا غيور فقال: أما ابنتها؛ فندعو الله أن يغنيها عنها. وأدعو الله أن يذهب بالغيرة.

الأعظمي 3386صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Patience in tribulation and illness
Section
What is said upon affliction
Numbering
Jami al-Kamil 3386 (2nd edition)
Azami 3386