Dua to protect yourself From sudden Punishment
اَللّٰهُمَّ قِنِيْ عَذَابَكَ يَوْمَ تَبْعَثُ عِبَادَكَ.
Translation :
O Allah, protect me from Your punishment on the day You resurrect Your servants.
Transliteration :
Allāhumma qinī ʿadhābaka yawma tabʿathu ʿibādak.
Hadith:
Hafsah (raḍiy Allāhu ‘anhā), the wife of the Messenger of Allah ﷺ narrates that when the Messenger of Allah ﷺ wanted to go to sleep, he put his right hand under his cheek and would then say [the above] three times. (Abū Dāwūd 5045)