When about to sleep

The Prophet (sal-Allaahu 'alayhe wa sallam) would place his right hand under his cheek when about to sleep and supplicate:

اَللّٰهُمَّ قِنِيْ عَذَابَكَ يَوْمَ تَبْعَثُ عِبَادَكَ

O Allaah, protect me from Your punishment on the day Your servants are resurrected.'

Allaahumma qinee 'athaabaka yawma tab'athu 'ibaadaka.

...three times