What one Says in the Morning, the Evening and when going to Sleep - Section 2 Mishkat al-Masabih 2402

Arabic hadith text
وَعَن حَفصةَ رَضِيَ اللَّهُ عَنْهَا أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ كَانَ إِذَا أَرَادَ أَنْ يَرْقُدَ وَضَعَ يَدَهُ الْيُمْنَى تَحْتَ خَدِّهِ ثُمَّ يَقُولُ: «اللَّهُمَّ قِنِي عَذَابَكَ يَوْمَ تَبْعَثُ عِبَادَكَ» . ثَلَاثَ مَرَّاتٍ رَوَاهُ أَبُو دَاوُد
Translation

Hafsa said that when God’s messenger wanted to go to sleep he put his right hand under his cheek, and would then say three times, "O God, guard me from Thy punishment on the day when Thou raisest up Thy servants." Abu Dawud transmitted it.