In principle, on Yom Tov one may repair makhshirei okhel nefesh, items that are necessary to prepare food on Yom Tov. However, for a variety of reasons, in practice we almost never permit repairing makhshirei okhel nefesh on Yom Tov. First, when the repair could have been done before Yom Tov, it is prohibited by Torah law to do it on Yom Tov (Beitza 28b). Second, according to some authorities (Ha-ma’or and Ran), the permissibility is limited to cases where the repair is partial, whereas a complete repair is prohibited. In many cases, it is difficult to determine which category a specific repair would fit into. For example, the permissibility of sharpening a knife is disputed, with many maintaining that one may not do so because it is considered actually creating a kli (SA 509:2). Third, when the repair is not necessary because the food could be prepared even without it, albeit with difficulty, one may not repair the item, as doing so is deemed an excessive and unnecessary effort (Rema 509:1). Fourth, only something that is one step removed from actual food preparation may be repaired, while something two steps away (makhshirei makhshirim) may not be repaired. For example, one may not shave down a key in order to unlock the door of a room in which food is located, since the key itself is not necessary for food preparation. It only allows access to the food.
Additionally, even in a case where it is clear that one may repair something used in food preparation, in practice the Sages generally did not allow it, out of concern that as a result of being lenient when it comes to repairing items for okhel nefesh that could not have been repaired before Yom Tov, people will end up repairing items on Yom Tov that could have been repaired beforehand, thus transgressing a Torah prohibition (Beitza 28b; Rema 509:1). Therefore, a student of halakha who knows when repairs are permitted may act in accordance with his knowledge, but if one comes to a rabbi with a question about a particular case without studying the entire issue, he should not be given permission, because he might end up being lenient about what is prohibited.
Nevertheless, when a repair is absolutely necessary for food preparation, the Sages explicitly ruled leniently (Ramban). Therefore one may sweep plaster out of his oven if it is causing the food inside to burn, on condition that he could not have done so before Yom Tov. That would be the case, for example, if the plaster caused the problem on Yom Tov itself, or if one was unaware of the problem before Yom Tov (Beitza 28b; SA 507:4). It seems that the Sages felt that the grounds for permitting this necessary repair were easily understandable, so they were not concerned that people would extrapolate incorrectly and permit the forbidden.[7]
The Rishonim disagree about this law as well. Some argue that in practice one should follow R. Yehuda (Ra’avad and Ri’az), while others rule that the law follows the Sages (Or Zaru’a, Magid Mishneh’s understanding of Rambam). The vast majority of Rishonim maintain that the law follows R. Yehuda, but that those who ask should not be told so. This is the position of Behag, Ha-ma’or, Yere’im, and Smag. It is also implied by Rif and Rambam (according to most commentators). Ramban (in Milḥamot Hashem) explains the opinion of the Gemara and most of the Rishonim, namely, that the law technically accords with R. Yehuda, but unless there is a great need, this ruling is not rendered. This explains why sweeping out one’s oven is permitted even le-khatḥila (since it is absolutely necessary), while sharpening a knife is permitted only partially and theoretically (since it is not so necessary). Actions that are not directly connected to okhel nefesh – extinguishing a log in order to prevent the house from getting smoky, or extinguishing a candle in order to allow marital relations – are not permitted at all, out of a concern that people would end up being lenient even when there is no room for leniency, as is explained in Beitza 22a. This is also the opinion of Rashba, Ran, Rosh, and many other Rishonim, as well as many Aḥaronim. See Harḥavot here. Furthermore, there are additional uncertainties as to which repairs are partial and which are complete, which are truly necessary and which are not. Thus it emerges that, in practice, we are almost never lenient when it comes to repairing makhshirei okhel nefesh. This seems to be the position of Shulḥan Arukh, which on the one hand states explicitly that the law follows R. Yehuda (495:1) and that one may sweep out his oven (507:4), yet on the other hand forbids repairing a skewer or sharpening a knife (509:1).