´It was narrated that Abu Musa said:` "A house burned down in Al-Madinah, with its occupants inside. The Prophet(ﷺ) was told of what had happened, and he said: 'This fire is an enemy to you. When you go to sleep, extinguish it.'"
Related hadith on this topic
Explanation & Benefits
Shaykh Abdul Sattar al-Hammad
Hadith Commentary:
(1)
In this hadith, the wisdom behind extinguishing the fire before sleeping is explained: there is a risk of burning from it. This applies to any fire, whether it is a lamp or a stove. In addition, the same ruling applies to gas heaters and electric bulbs.
(2)
Fire has been described as an enemy because there is always a risk of harm to life and property from it, just as there is danger from an enemy, even though it also has countless benefits.
(Fath al-Bari: 11/103)
Source: Hidayat al-Qari: Commentary on Sahih Bukhari, Urdu, Page: 6294