The Messenger of Allah ﷺ used to rest his right hand under his cheek as a pillow when going to sleep, then say, "My Lord, protect me from Your punishment on the Day You resurrect Your servants."
حدثنا أبو كريب أخبرنا إسحق بن منصور هو السلولي عن إبراهيم بن يوسف بن أبي إسحق عن أبيه عن أبي إسحق عن أبي بردة
كان رسول الله ﷺ يتوسد يمينه عند المنام ثم يقول رب قني عذابك يوم تبعث عبادك
[Its chain of transmission is sahih]. Nasai also narrated it in Amal al-Yawm wal-Layla, no. 758, from the hadith of Ishaq bin Mansur, with the same wording.Abu Ishaq stated explicitly that he heard it directly, as recorded by Nasai in al-Kubra, no. 10594, and by Abu Shaykh in Akhlaq al-Nabi, p. 167, and others. Ibn Hibban graded it sahih, no. 2350, as did the Hafiz in al-Fath.The hadith of Thawri is found in Nasai's al-Kubra, no. 753, and in Ahmad, 4/290, 298, 303. The hadith of Shuba is found in Nasai's al-Kubra, no. 754, and elsewhere. The hadith of Sharik is found in Tirmidhi's al-Shamail, no. 252. The hadith of Abu Ubayda, from Abdullah, is found in Ibn Majah, no. 3877.