Preparing on the 1st day of Yom Tov on behalf of the 2nd day of Yom Tov or Shabbos:
Preparing on 1st day on behalf of 2nd day in Chutz Laaretz:
It is forbidden to do anything on the 1st day of Yom Tov on behalf of the next day, including on behalf of the 2nd day in the Diaspora. This applies even for the two days of Rosh Hashanah which is considered like one long day. [This applies even in a year that Shabbos falls after Yom Tov and one performed Eruv Tavshilin before Yom Tov.] This prohibition applies even against doing acts of preparation that do not contain any forbidden Melacha at all. [Rather, all the preparations for the 2nd night are to be done after Tzeis Hakochavim/nightfall of the first day. Some Poskim however rule that in a time of need, one may be lenient to prepare on the first day of Yom Tov on behalf of the 2nd day, if one completes the preparation with much time left in the day, and the preparation does not involve any Melacha normally forbidden to be done on Shabbos.]
Examples: One must beware not to bring wine on the first day of Yom Tov on behalf of Kiddush of the second night. Likewise, one is not to search in a Sefer Torah on the first day of Yom Tov for the reading of the second day, or for Shabbos, even if one performed Eiruv Tavshilin. Likewise, one may not wash dishes on the first day on behalf of the second day [until after Tzeis Hakochavim]. [Likewise, one may not make the beds [or tidy the home] on the first day of Yom Tov on behalf of the next day, unless it is also done for the sake of having a clean home on the first day of Yom Tov. Likewise, one may not set the table or prepare the candles until after Tzeis Hakochavim.]
Preparing on 1st day on behalf of Shabbos:
Even in a scenario that Shabbos falls after the 2nd day of Yom Tov, it is forbidden to prepare on the 1st day of Yom Tov, on behalf of Shabbos, even when Eruv Tavshilin has been done. Rather, all preparations for Shabbos are to be done on the 2nd day of Yom Tov.
It is forbidden to do anything on the 1st day of Yom Tov on behalf of the 2nd day, or on behalf of Shabbos, even if the action does not involve any forbidden Melacha, and even if one performed Eiruv Tavshilin. This applies until after Tzeis Hakochavim of the first day.
May one remove food from the freezer on the first day of Yom Tov on behalf of the second night meal?
When are the Yom Tov candles to be lit on the 2nd night of Yom Tov?
On the second night of Yom Tov, the candles are lit after nightfall, and not before sunset of the first day.
May one prepare and do Melacha on the night of Yom Tov on behalf of the day meal?
May one ask a gentile to prepare on the first day of Yom Tov on behalf of the second day?
It is permitted to have a gentile perform preparations on the first day of Yom Tov, on behalf of the second day, so long as the action does not involve any Melacha that is generally forbidden on Shabbos. Thus, one may ask a gentile to wash dishes or sweep the floor, or set up the table, on behalf of the second day.
 Admur 503/1-3; Michaber 503/1 regarding Melacha; Rama 667/1 regarding Hachana
 Admur 503/1-2 regarding Melacha from Yom Tov to weekday or Shabbos, and 503/3 regarding Hachana from Yom Tov Rishon to Yom Tov Sheiyni Shel Galiyos; Michaber ibid regarding Melacha
Is the prohibition Biblical or Rabbinical? All the Melachos of Ochel Nefesh were only permitted to be performed on Yom Tov for the sake of benefiting from it on Yom Tov. It is however forbidden to bake, slaughter, and cook on Yom Tov for the sake of eating it after Yom Tov. One who does so, transgresses a Biblical prohibition and is liable for lashes. [Admur 495/2 “For the sake of eating on Yom Tov”; 503/1-2; 527/8; M”A 518/1 “One who cooks on Yom Tov for the weekday gets lashes”; M”B 527/3; Rambam Yom Tov 1/9; Beitza 17a; Pesachim 46b; See Aruch Hashulchan 527/3; Piskeiy Teshuvos 527/3 for other opinions in this matter] This however only applies if the Melacha was done on Yom Tov near evening in a way that one cannot benefit from it at all on Yom Tov itself [do to there not being enough time to receive the benefit]. If, however, it is possible for one to benefit from the food on Yom Tov itself, then he is exempt from a Biblical transgression even if he does not plan to benefit from it on Yom Tov and intended to do the Melacha for the sake of eating the food the next day. Nevertheless, the Sages prohibited this to be done, and one who does so is liable for Rabbinical lashes. Even if the Melacha is not needed at all for Yom Tov, being that one already ate all his meals in entirety, it is nevertheless only Rabbinically forbidden. [Admur 503/2; M”A 527/1; Razah Pesachim 14b; Ran ibid] The reason it is only Rabbinical, is because if he were to receive guests that did not yet eat that day, then this Melacha would be considered a need for the guests, and would have been permitted to be performed by him. Therefore, this Melacha is called Mileches Ochel Nefesh, and even though he does not have guests, its performance does not contain a Biblical prohibition. [Admur 503/2; M”A 527/1; Tosafus Pesachim ibid]
 Admur 503/3; Michaber 503/1; Drashos Maharil Hilchos Rosh Hashanah; Hagahos Maimanis in name of Semak
The reason: Although the two days of Rosh Hashanah is one holiness, and is considered long day, nevertheless, this only applies for purposes of stringency and not to leniency. The reason for this is because as we are expert in the date of the month, and we know that the first day is holy from a Biblical perspective, while the 2nd day is completely mundane according to the Biblical perspective, and it is thus found that one is preparing on Yom Tov for a weekday. [Admur ibid; M”A 503/1; Taz 503/1; Beis Yosef; Levush; Kneses Hagedola 503/1; Drashos Maharil Hilchos Rosh Hashanah; Hagahos Maimanis in name of Semak; Shulchan Gavoa 503/2; Kaf Hachaim 503/10]
 Pashut, as Eiruv Tavshilin only permits doing Melcha from Friday to Shabbos. [Admur 527/23]
 Admur 503/3; 254/10; 494/14; Rama 667/1; M”A 503/1 based on Michaber 416/2; Hagahos Maimanis; Maharil; M”B 503/1; 667/5
 P”M 503 M”Z 1; Kaf Hachaim 503/4
The reason: As we never allow one to initially be lenient by a Safek Derabanon. [P”M ibid]
 Chayeh Adam 153/6; M”B 667/5; Kaf Hachaim 503/2; See Maharshag 1/61
 Admur 503/3; M”A 667/3; Chayeh Adam 99/1; 153/6; M”B 667/5; Kaf Hachaim 503/2
 Admur 503/3; M”A 667/3; Maharial Hilchos Tefilas Yom Tov
 Admur 503/3; Elya Raba 503/1; Drashos Maharil Hilchos Yom Tov p. 180; Minhagei Maharash 394
 M”B 667/5; Admur 302/10 regarding Shabbos
 Admur 527/23; Michaber 527/13; Ran Beitza 9b; Ittur Jilchos Yom Tov 147b; Rashba 1/685; Rosh Klal 23/8
 Shevet Hakehasi 1/158; Piskeiy Teshuvos 503/1; Based on ruling of Chayeh Adam 153/6; M”B 667/5; Kaf Hachaim 503/2; Maharshag 1/61
 The reason: As in a time of need, one may prepare on the first day on behalf of the second day if the action does not involve a Melacha. [Chayeh Adam 153/6; M”B 667/5; Kaf Hachaim 503/2]
 SSH”K 10/10
 Mateh Efraim 599/10; Hiskashrus 947
 The reason: As one is not to do an action on the 1st day of Yom Tov on behalf of the 2nd day. [Alef Hamagen 625/51]
 PT 503/3
 PT 503/2
 Beis Dovid 285; Birkeiy Yosef 503/1; Mamar Mordechai 503/1; Kaf Hachaim 503/6
 P”M 503 A”A 1; Kaf Hachaim 503/1; Minchas Yom Tov 101/8; Piskeiy Teshuvos 503/1