It is reported from the Messenger of Allah ﷺ that whenever he lay down to sleep, he would say, "O Allah, in Your name, my Lord, I lay down my side, so forgive me."
عن رسول الله ﷺ أنه كان إذا اضطجع للنوم يقول: اللهم باسمك ربي وضعت جنبي فاغفر لي.
Nasai narrated it in Amal al-Yawm wal-Layla (770), and Ibn Sunni related it from him (716), from Yunus bin Abdul-Ala, who said, Abdullah bin Wahb informed us, Huyayy bin Abdullah told me, from Abu Abdul-Rahman Hubli, from Abdullah bin Amr, and he related it.Ahmad also related it (6620) from Hasan, from Ibn Lahia, from Huyayy, with the same wording. Its chain of transmission is hasan because of Huyayy bin Abdullah, for his hadith is hasan unless the opposite becomes clear. Ibn Hajar also graded it hasan in Nataij Afkar.