I heard the Messenger of Allah ﷺ say, "There is no servant who is struck by a calamity and says, 'Indeed we belong to Allah, and to Him we shall return. O Allah, reward me in my calamity and replace it for me with something better,' except that Allah rewards him in his calamity and grants him something better in its place."She said, "When Abu Salama died, I said to myself, 'Who could be better than Abu Salama, the companion of the Messenger of Allah ﷺ?'"She continued, "Then Allah gave me the resolve to say it, so I said, 'O Allah, reward me in my calamity and replace it for me with something better.'"She said, "And so I married the Messenger of Allah ﷺ."
حدثنا ابن نمير قال حدثنا سعد بن سعيد قال أخبرني عمر بن كثير عن ابن سفينة مولى أم سلمة
سمعت رسول الله ﷺ يقول ما من عبد تصيبه مصيبة فيقول إنا لله وإنا إليه راجعون اللهم أجرني في مصيبتي واخلفني خيرا منها إلا أجره الله في مصيبته وخلف له خيرا منها قالت فلما توفي أبو سلمة قلت من خير من أبي سلمة صاحب رسول الله ﷺ قالت ثم عزم الله عز وجل لي فقلتها اللهم أجرني في مصيبتي واخلف لي خيرا منها قالت فتزوجت رسول الله ﷺ
Its isnad is sahih. Umar bin Kathir is Ibn Aflah al-Madani, whose hadith appears in Sahihayn, and he is trustworthy. The same applies to Umar bin Shuayb, whose hadith appears in Sunan. The hadith has already appeared at 26487.