إِنَّا لِلَّهِ وَإِنَّا إِلَيْهِ رَاجِعُونَ، اللَّهُمَّ أَجِرْنِي فِي مُصِيبَتِي وَاخْلُفْ لِي خَيْرًا مِنْهَا
Inna lillahi wa inna ilayhi raji'un, Allahumma ajirni fi musibati wakhluf li khayran minha
Indeed, to Allah we belong and to Him we shall return. O Allah, reward me for my affliction and replace it with something better.
Recite when facing any calamity or loss
Umm Salamah (RA) said this when her husband died, and Allah replaced him with the Prophet (PBUH) as her husband.