On Yom Tov, a fire may be extinguished (kibui) only for the needs of okhel nefesh. Otherwise, it is forbidden. Even if all of one’s possessions are going up in flames, extinguishing the fire is prohibited as long as there is no danger to human life. Lowering a flame is also prohibited when there is no tzorekh okhel nefesh, as this of necessity involves extinguishing part of the flame (Beitza 22a; SA 514:1-2; Peninei Halakha: Shabbat 16:6-7).
In contrast, extinguishing a flame as part of food preparation is permitted. Therefore, raw meat may be placed upon coals, even though the juices dripping from the meat will initially put out part of the flame (Shabbat 34b; SA 511:4). Spices may also be put on the coals in order to infuse fruit with their flavor, even though initially the spices will put out part of the flame. Similarly, the flame under a pot of food may be turned down if it is so high that the food in the pot will burn. However, if a lower flame is available, the pot should be transferred there, thus avoiding unnecessary kibui.
Let us say a fire is threatening to burn down one’s home, where he is planning to eat his Yom Tov meals. Alternatively, the fire is threatening to ruin the crockery and cutlery with which he is planning to eat the meals. May it be extinguished? Poskim disagree. Some prohibit extinguishing the fire, as doing so does not directly affect the food (Rif; Rambam; SA 514:1). Others permit it, maintaining that the permission to perform melakha for okhel nefesh includes the permission to protect the place in which one will eat and the crockery and cutlery with which one will eat. Therefore, as long as one does not have anywhere else convenient to eat besides his home, he may put out a fire which is about to burn it down. Similarly, if he cannot lay hands on other crockery and cutlery with which to eat, he may extinguish the fire which is about to ruin them (Mordechai; Ran; Rema 514:1; MB ad loc. 8). Since this is a disagreement pertaining to a rabbinic law, the lenient opinion may be relied upon when necessary.
If an existing flame is too high and the food is likely to burn, but a weaker flame is available to which it can be transferred, the food must be moved there to avoid lowering the flame unnecessarily (Rosh; Rema 514:1). If no weaker flame is available, some say that it is better to light a new fire rather than to lower the existing one (MA 514:3; MB ad loc. 6). Others maintain that it is better to turn down the existing flame (Igrot Moshe, OḤ 4:103; Yabi’a Omer 1:31:12). In practice, this position would seem to be correct, for two reasons. First, the extinguishing here is le-tzorekh okhel nefesh, and second, the uncertainty is on a rabbinic level, and the principle is that we are lenient in such cases. See Harḥavot.