Al-Adab Al-Mufrad, Book 50, Hadith 1215 (In-Book)

Al-Bara' said, "When the Prophet, may Allah bless him and grant him peace, wanted to go to sleep, he put his hand under his right cheek and said, 'O Allah, protect me from Your punishment on the Day you raise up Your slaves.'"

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

sunnah.com