Sunan Abi Dawud, Hadith 5045

Narrated Hafsah, Ummul Mu'minin: When the Messenger of Allah wanted to go to sleep, he put his right hand under his cheek and would then say three times: O Allah, guard me from Thy punishment on the day when Thou raisest up Thy servants.

حَدَّثَنَا مُوسَى بْنُ إِسْمَاعِيلَ، حَدَّثَنَا أَبَانُ، حَدَّثَنَا عَاصِمٌ، عَنْ مَعْبَدِ بْنِ خَالِدٍ، عَنْ سَوَاءٍ، عَنْ حَفْصَةَ، زَوْجِ النَّبِيِّ صلى الله عليه وسلم أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم كَانَ إِذَا أَرَادَ أَنْ يَرْقُدَ وَضَعَ يَدَهُ الْيُمْنَى تَحْتَ خَدِّهِ ثُمَّ يَقُولُ ‏ "‏ اللَّهُمَّ قِنِي عَذَابَكَ يَوْمَ تَبْعَثُ عِبَادَكَ ‏" ‏ ‏.‏ ثَلاَثَ مِرَارٍ ‏.‏

sunnah.com

also referenced under: Hadith 5027 (Hasan)