when a tragedy strikes: Umme Salama’s husband was a very good man. When he died leaving behind small children, she was grieved. The Propeht (saw came to offer condolence, and asked her to recite this dua. She did, but thought: “I am old and with children. How can I get a better husband than Abu Salama?”
After the Iddah, the prophet (saw) proposed to her, and she was married to the best man ever.
This is the duaa that Umm Salama(R.anha) made as taught to her by Abu Salama (R.an) as taught to him by Prophet Muhammad (SalAllahu Alayhi Wa Sallam).
Which resulted in Allah giving Umm Salama (R.anha) the Prophet Muhammad (SalAllahu Alayhi Wa Sallam) as a husband, when Abu Salama (R.an) passed away.
إِنَّا لِلَّهِ وَإِنَّا إِلَيْهِ رَاجِعُوْنَ، اَللَّهُمَّ أْجُرْنِيْ فِيْ مُصِيْبَتِيْ وَأَخْلِفْ لِيْ خَيْرًا مِنْهَا.
‘Innaa lillaahi wa ‘innaa ‘ilayhi raaji’oon, Allaahumma’-jurni fee museebatee wa ‘akhliflee khayran minhaa
‘To Allaah we belong and unto Him is our return. O Allaah, recompense me for my affliction and replace it for me with something better.’
[ Muslim 2/632 ]