Sahih al-Bukhari 6324
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
حَدَّثَنَا أَبُو نُعَيْمٍ، حَدَّثَنَا سُفْيَانُ، عَنْ عَبْدِ الْمَلِكِ بْنِ عُمَيْرٍ، عَنْ رِبْعِيِّ بْنِ حِرَاشٍ، عَنْ حُذَيْفَةَ، قَالَ كَانَ النَّبِيُّ صلى الله عليه وسلم إِذَا أَرَادَ أَنْ يَنَامَ قَالَ بِاسْمِكَ اللَّهُمَّ أَمُوتُ وَأَحْيَا ". وَإِذَا اسْتَيْقَظَ مِنْ مَنَامِهِ قَالَ " الْحَمْدُ لِلَّهِ الَّذِي أَحْيَانَا بَعْدَ مَا أَمَاتَنَا، وَإِلَيْهِ النُّشُورُ "."
Narrated Hudhaifa:
Whenever the Prophet (ﷺ) intended to go to bed, he would recite: "Bismika Allahumma amutu wa ahya (With Your name, O Allah, I die and I live)." And when he woke up from his sleep, he would say: "Al-hamdu lil-lahil-ladhi ahyana ba'da ma amatana; wa ilaihi an-nushur (All the Praises are for Allah Who has made us alive after He made us die (sleep) and unto Him is the Resurrection). "
Full reference and source
Sahih al-Bukhari 6324 In-book : Book 80, Hadith 21 USC-MSA web (English) : Vol. 8, Book 75, Hadith 336 (deprecated)
View source on Sunnah.com (opens in a new tab)