Abu Dharr reported,

When the Prophet ﷺ would lie down to sleep at night, he would say, "In Your name we die and we 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 7395

Sahih

حدثنا سعد بن حفص حدثنا شيبان عن منصور عن ربعي بن حراش عن خرشة بن الحر

عن أبي ذر قال

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

البخاري 7395صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tawhid
Chapter
Asking by the names of Allah and seeking refuge by them
Numbering
Darussalam 7395
Bukhari 7395