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."
كان النبي ﷺ إذا أخذ مضجعه من الليل وضع يده تحت خده ثم يقول: اللهم باسمك أموت وأحيا. وإذا استيقظ قال: الحمد لله الذي أحيانا بعد ما أماتنا وإليه النشور.
Bukhari related it in the Book of Supplications (6314), from Musa bin Ismail, who said, "Abu Awana narrated to us, from Abdul-Malik, from Rubai, from Huzaifa," and he mentioned it.