The Messenger of Allah ﷺ as saying: When one of you is afflicted with a calamity, he should say: "We belong to Allah, and to Him we do return." O Allah, I expect reward from Thee from this affliction, so give me reward for it, and give me a better compensation. (Using translation from Abū Dāʾūd 3119)
أَنَّ رَسُولَ اللهِ ﷺ قَالَ إِذَا أَصَابَتْ أَحَدَكُمْ مُصِيبَةٌ فَلْيَقُلْ إِنَّا لِلَّهِ وَإِنَّا إِلَيْهِ رَاجِعُونَ اللهُمَّ عِنْدَكَ أَحْتَسِبُ مُصِيبَتِي فَأْجُرْنِي فِيهَا وَأَبْدِلْنِي بِهَا خَيْرًا مِنْهَا فَلَمَّا قُبِضَ أَبُو سَلَمَةَ خَلَفَنِي اللهُ ﷻ فِي أَهْلِي خَيْرًا مِنْهُ