Do not light a fire in any of your dwellings on the Shabbat day (Exodus 35:3)
Many activities are forbidden on the Shabbat (39 major categories). Why does the Torah single out “fire”? Rashi cites an opinion in the Talmud that fire is singled out because it is a less severe transgression than the other activities; the other opinion maintains that fire is singled out in order to teach that every single one of the prohibited activities on Shabbat is considered a distinct prohibition, not just a generic desecration of Shabbat. Some commentaries (Ramban, Rashbam) explain that since the Torah permits cooking on the festivals for the sake of the festival, the Torah emphasizes that in contrast, cooking on Shabbat, even for the sake of Shabbat, is forbidden. The Sforno points out that since fire actually destroys that which it burns, and the only activities forbidden as desecration of Shabbat are constructive actions, one might think that fire is permitted. Therefore the Torah goes out of its way to explain that fire is indeed forbidden on Shabbat.