O you who believe! Be not like those who disbelieve (hypocrites) and who say to their brethren when they travel through the earth or go out to fight: "If they had stayed with us, they would not have died or been killed," so that Allâh may make it a cause of regret in their hearts. It is Allâh that gives life and causes death. And Allâh is All¬Seer of what you do.
(Surah Al Imran 156)
Supplication for submitting to the decree
قَدَّرَ اللهُ وَمَا شَاءَ فَعَلَ
Qaddar-Allaahu wa maa shaa’a fa‛al
Allah has decreed and what He wills, He does
The Messenger of Allah (ﷺ) said: If a mishap should happen to befall you then do not say, “If only I had acted, such and such would have happened.”
Rather, say: “Allah has decreed and what He wills, He does.” For verily (the word) 'IF' lets in the work of the devil.
(Sahih Muslim 2664)