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)
"إِذَا أصاب أحدَكم مصيبة فليقلْ: إنَّا للهِ وإنا إليه راجعون- اللهم عندك أحتسب مُصيبتى فأجُرنى فيها وأبْدِلنى بها خيرًا مِنْها".