Abu Hurairah (May Allah be pleased with him) reported:
The Messenger of Allah (ﷺ) said, "When any of you goes to bed, he should shake off (or dust off) his bedsheet because he does not know what might have fallen on it after he had left it. Then he should recite: 'Bismika Rabbi wada'tu janbi, wa bika arfa'uhu, in amsakta nafsi farhamha, wa in arsaltaha fahfazha bima tahfazu bihi 'ibadakas-salihin [With Your Name, my Rubb, I place my side (upon the bed) and with Your Grace I will raise it up. If You withhold my soul (cause me to die), have mercy on it but if You let it go (let me live), guard it against which You guarded Your pious slaves]."'[Al- Bukhari and Muslim].
App reference: Book 16, Hadith 53
Arabic/English book reference: Book 16, Hadith 1460