Umm Salamah (رضى الله عنها) reported: I heard the Messenger of Allah (ﷺ) saying, “When a person suffers from a calamity and utters:
إنَّا للـهِ وإنَّا إلَيْهِ رَاجِعُونَ، اللَّهُمَّ أجُرْنِي فِي مُصِيْبَتي، وأخْلِفْ لِي خَيْراً مِنْهَا
Inna lillahi wa inna ilaihi raji’un. Allahumma-jurni fi musibati, wa akhlif li khairan minha
(We belong to Allah and to Him we shall return. O Allah! Compensate me in my affliction, recompense my loss and give me something better in exchange for it)
then Allah surely compensates him with reward and better substitute.”
Also narrated with the following words in Tirmidhi: “When one of you is afflicted with a calamity, he should say:
إنَّا لِلَّهِ وَإِنَّا إِلَيْهِ رَاجِعُونَ اللَّهُمَّ عِنْدَكَ أَحْتَسِبُ مُصِيبَتِي فَآجِرْنِي فِيهَا وَأَبْدِلْ لِي خَيْرًا مِنْهَا
Inna Lillahi Wa Inna Ilaihi Raji’un, Allahumma Indaka Ahtasibu Musibati Fa’jirni Fiha Wa Abdil li Khairan Minha
(We belong to Allah, and to Him we do return. O Allah, I seek reward with You for my affliction, so reward me for it, and replace it for me with something better