The Messenger of Allah ﷺ said, "Do not leave fire burning in your homes when you go to sleep."
حدثنا ابن أبي عمر وغير واحد قالوا حدثنا سفيان عن الزهري
قال رسول الله ﷺ لا تتركوا النار في بيوتكم حين تنامون
Agreed upon (by Bukhari and Muslim). Bukhari narrated it in the book of Seeking Permission, chapter "Do not leave fire burning in the house while sleeping," hadith no. 6293, and Muslim, hadith no. 2015, from the hadith of Sufyan bin Uyayna, with this wording.