365. If something unpleasant happens
قَدَّرَ اللَّهُ وَمَا شَاءَ فَعَلَ
Qaddar-Allahu wa maa shaa’a fa‛al
Allah has decreed and what He wills, He does.
Abu Huraira (RA) reported Allah's Messenger (ﷺ) as saying: A strong believer is better and is more lovable to Allah than a weak believer, and there is good in everyone, (but) cherish that which gives you benefit (in the Hereafter) and seek help from Allah and do not lose heart, and if anything (in the form of trouble) comes to you, don't say: If I had not done that, it would not have happened so and so, but say: (The dua is Mentioned above) your "if" opens the (gate) for the Satan.
Related Duas:
Satan's enmity towards the newborn
Prayers and answers for the father of the newborn #1
If afflicted with doubt in one's faith #1
When you enter the mosque, seek refuge from the devil #1
What should be said to chase shaytaan
Seeking refuge from the devil when leaving the mosque
Prayer for the suppression of anger #2
If afflicted with doubt in one's faith #2
Dua when afflicted by whisperings of the devil in prayer or recitation
Prayers and answers for the father of the newborn #2
Pray to Allah for refuge from Satan
Dua for expelling the devil and his whisperings #1