We are permitted to prepare and cook food on Yom Tov for that day of Yom Tov (when those foods are superior if freshly cooked, and we may prepare and cook in an irregular manner, with a shinui, if unable to do this prior to Yom Tov. See Rama, OCh 495:1 and Mishna Berura ibid. 9 & 10)
We may not plan to cook food on the first day of Yom Tov specifically for the second day of Yom Tov.
When cooking, one may cook generous amounts and use remaining food for the next day. See Shulchan Aruch, OC, (503:1).
When Yom Tov occurs on Friday, an Eruv Tavshilin is prepared by which we may cook on Yom Tov for Shabbos ShO OCh 527.
Although it is forbidden to ignite a new flame on Yom Tov by striking a match or activating an electric flame or light for example, we may however transfer or increase an existing flame for Yom Tov purposes (defined as "Davar HaShave LeKol Nefesh", Tosfos Shabbos 39b and Beitza 21b)
It is suggested that one should, if possible, light the cooking flame directly from the existing flame. Lighting a taper may be prohibited since it is not directly for the purpose of cooking. [Shu”t Minchas Yitzchok (5:16) and Shu”t Be’er Moshe(8:179) “The Laws of Yom Tov” by Rabbi Simcha Bunim Cohen] However, Shemiras Shabbos Kehilchasa, Vol. 1 (13:3) permits using an intermediary match to transfer a flame under any circumstances. This makes sense since a fire that is almost out of fuel may certainly be topped up even though it is only required in order to have it available if and when required for cooking.
It is generally forbidden to extinguish or reduce a flame on Yom Tov (Tosfos Beitza (22a) “V’Hamistapek”, ShO OC 514:1) unless it serves to prevent food becoming spoiled or is otherwise for our comfort e.g. the room is too warm, Rama, OC (514:1). Some suggest that the food must be moved to another smaller flame or a heat spreader be interposed between the pot and the flame or a window be opened if the room is too warm rather than reduce the flame; whilst others permit whatever is usually done in such circumstances. [Shu”t Igros Moshe, OC (1:115) and (4:103); Shu”t Emek Hateshuva (1:83). Shu”t Chelkas Yaakov (1:60:9); Kinyan Torah (2:98); She’arim M’tzuyanim B’halacha(98:13); Shu”t Mishne Halachos (7:75)]
Gas Stoves and Ovens The older type of gas cookers, hot water services and room heaters often have a pilot light which burns continuously. Such cookers and heaters may be “turned on” and used on Yom Tov since the main flame is ignited from the existing pilot flame.
The newer types of gas appliances use electronic ignition systems to ignite their flame. When the device is operated and the gas begins to flow, a rapid series of sparks ignites the gas. These devices may not be activated on Yom Tov.
Storage hot water systems, as opposed to instant hot water systems, will cycle on and off in order to maintain the set temperature. They may not be adjusted to a higher setting on Yom Tov unless the main flame is already ignited. When the main flame is not burning, the thermostat setting may be reduced.
Electric Stoves and Ovens Electric appliances operated on a thermostat will cycle on and off in order to maintain the set temperature. If the device is active, it may be adjusted to a higher setting since this just extends the duration of its activity and nothing is being activated. Of course this assumes that the controls themselves are not digital/electronic but mechanical. When the heating element is not activated, the appliance may be adjusted to a lower setting since this just extends the duration of its inactive phase. Since this is a permitted activity the controls. Many ovens have an indicator light that lights up when the appliance is active. Such lights can be installed by an electrician.
Sabbath Mode Ovens Some appliances are designed with a Sabbath Mode. This permits various but not all uses on Shabbos and Yom Tov. For example, to open and close the door of the oven at will, even on Shabbos, since the thermostat does not constantly monitor the oven temperature but only randomly checks the settings. This creates what is known as a Gerama situation, meaning that the actions performed are not linked to the person performing them. Sabbath Mode also overrides various safety shut down features and warning lights and alarms.