Huzaifa bin Yaman reported,

When the Prophet ﷺ lay down to sleep at night, he would place his hand under his cheek and say, "O Allah, in Your name I die and I live." When he awoke, he would say, "Praise be to Allah who has given us life after causing us to die, and to Him is the resurrection."

Azami 11234

Sahih

عن حذيفة قال

كان النبي ﷺ إذا أخذ مضجعه من الليل وضع يده تحت خده ثم يقول: اللهم باسمك أموت وأحيا. وإذا استيقظ قال: الحمد لله الذي أحيانا بعد ما أماتنا وإليه النشور.

الأعظمي 11234صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Supplications, remembrances, and prayer upon the chosen Prophet ﷺ
Chapter
Morning and evening supplications
Section
Supplications and remembrances narrated when going to sleep and when waking up
Numbering
Jami al-Kamil 11234 (2nd edition)
Azami 11234