The afflicted person should show patience at the very first shock
It is narrated from Anas (may Allah be pleased with him) that the Prophet ﷺ said:
إنما الصبر عند الصدمة الأولى
“Patience is only that which is shown at the first shock.”
Reference: Bukhari: 1283, Muslim: 926, Abu Dawud: 3124, Tirmidhi: 988, Nasa’i: 22/4, Ahmad: 130/3
The afflicted person should recite the following supplications
➊ إِنَّا لِلَّهِ وَإِنَّا إِلَيْهِ رَاجِعُونَ
Reference: Al-Baqarah: 156
➋ اللَّهُمَّ أَجُرْنِي فِي مُصِيبَتِي وَأَخْلِفُ لِى خَيْرًا مِّنْهَا
Reference: Ahmad: 309/6, Muslim: 918, Ibn Majah: 1598