The Prophet (SAWS) would place his right hand under his cheek when about to sleep and supplicate:
اللّهُـمَّ قِنـي عَذابَـكَ يَـوْمَ تَبْـعَثُ عِبـادَك . (ثلاثاً)
Allahumma qinee AAathabaka yawma tabAAathu AAibadak. (three times).
‘O Allah, protect me from Your punishment on the day Your servants are resurrected.’ (three times)