One may not cook on Yom Tov for a regular weekday or Motza’ei Yom Tov. Similarly, in places outside of Israel, one may not cook on the first day of Yom Tov for the second (however, on years when the second day of Shavuot falls out on Shabbat, this Halacha changes, as we shall explain a different time). The same applies to Rosh Hashanah in that one may not cook on the first day for the second day.
Even something which is not regarded as actual “work” and is merely considered a bother may not be performed on the first day of Yom Tov (or Shabbat) for the second day of Yom Tov or for a weekday. Thus, one may not wash dishes on the first day of Yom Tov for the second day just as it is prohibited to wash dishes which were used for the third Shabbat meal, which is the case every Shabbat.
Although it is prohibited to cook on Yom Tov for Motza’ei Yom Tov, nevertheless, one may cook an entire pot of fish or meat before the Yom Tov day meal, even if one only has in mind to eat only one piece. This is because the rest of the food in the pot adds flavor to the food, for one cannot compare the taste of fish that was cooked in a pot full of other pieces of fish to a piece of fish cooked alone.
Nonetheless, one should preferably take care not to say aloud that one is cooking for a weekday. Rather, one should cook merely with the intention of the food being tasty in honor of Yom Tov.
However, after the afternoon meal, one may not cook food for the night (post-Yom Tov) by eating just one piece now, for this is not cooking for the sake of Yom Tov; rather it is just a trick. This means that since one is actually cooking for Motza’ei Yom Tov and one’s intention to eat one piece of food is merely an excuse to permit cooking on Yom Tov, this is called halachic “trickery” and is forbidden in this case.
Summary: One may not do anything on Yom Tov for the purpose of the following day. One may, nevertheless, cook an entire pot of food on Yom Tov with the intention of eating only one piece, for the food comes out tastier when it is more abundant. After the afternoon meal, this too is forbidden.