When the Prophet (ﷺ) would sleep, he would put his hand under his head then say: “O Allah, safeguard me from Your Punishment the Day You gather )” or “you resurrect your slaves (tab`athu `ibādak).”
Jami` at-Tirmidhi Book 48, Hadith 29