Hi, could you please explain the rules for cooking on a Yom Tov?
To be honest the full practical details are far beyond the scope of a single post; first you have to understand what you can’t do on Shabbos, and then you have to understand which of those prohibitions are waived and in what way on Yom Tov. This is also one of my weaker areas of halacha for the simple reason that I myself am never cooking on yontiff, because I’m always eating at someone else’s house (G-d willing I will get married soon and that will change). So I’ve learned it all in theory, but without the opportunity to experience it in practice, it’s not as easy to retain all the details. If this is a topic you want to learn about fully I would really recommend finding a rabbi, rebbetzin, or other knowledgeable person in your local community who might be willing to learn with you (I’m sure your local Chabad shluchim would love to help!).
Fire may only be kindled from an existing flame on yontiff. This means that while you can cook on your gas stove on yontiff, for example, you can’t turn the flame on on yontiff itself, but would rather need to have left it on from before yontiff (please take safety precautions if you do this). You also cannot turn off the flame on yontiff, as extinguishing a flame is not involved in the process of cooking food.
You can only cook food that will be used that day (where a day is defined as sundown to sundown). So if it’s a 2-day yontiff, you can’t cook anything for the 2nd day until after it gets dark that night. If there is a 3-day yontiff (2 days of yontiff followed by Shabbos) you must make what’s called an eruv tavshilin before yontiff in order to be allowed to cook for Shabbos on yontiff (since you can’t cook for Shabbos on Shabbos).
You may only do things on yontiff that could not have been done before yontiff (either because the food would not last at all that long, or because it would notably diminish its quality to cook it that far ahead of time).
This article provides some further details, although it is still not nearly an all-encompassing source for the details of the relevant laws.