If Yom Tov falls out on Friday (or on Thursday and Friday outside Israel), in general, one may not cook or bake from Yom Tov for Shabbat, however, if one cooked and there was leftovers it may be eaten on Shabbat. Yet, if one designated an Eruv Tavshilin from before Yom Tov then it’s permissible to cook or bake from Yom Tov for Shabbat.
Procedure and text
- One should hold the cooked and baked foods in one's right hand as one says the Bracha and Eruv stipulation. 
- The text of the Bracha for Eruv Tavshilin is: ברוך אתה ה' אלוקינו מלך העולם אשר קדשנו במצותיו וצונו על מצות עירוב. Then one should make the following stipulation: בדין יהא שרי לן לאפויי ולבשולי ולאטמוני ולאדלוקי שרגא ולמעבד כל צרכנא מיום טוב לשבת , meaning, "With this Eruv it should be permitted for us to bake, cook, insulate food, light a candle, and do any need from Yom Tov for Shabbat". One must understand what one is saying and if one doesn't understand the Aramaic one should say it in a language one understands.
What foods should be used for Eruv Tavshilin?
- A baked item such as bread and a cooked dish should be used for the Eruv Tavshilin.  The cooked dish must be something which is usually eaten with bread such as a piece of meat, fish, or eggs. 
- If one made the Eruv Tavshilin only using one cooked dish, after the fact it’s permissible. 
- If one made the Eruv Tavshilin only using one baked item, like bread, this isn’t considered a proper Eruv. 
- If one is only going to cook and not bake then one only needs one cooked dish. 
Size of Eruv Tavshilin
- The one baked dish and one cooked dish must be the size of a Kezayit and it’s preferable to use a whole loaf of bread and significant piece of meat or fish. 
After making Eruv Tavshilin, what are the laws of cooking on Yom Tov
- Eruv Tavshilin only permits one to cook on Friday for Shabbat and not Thursday for Shabbat.
- One should prepare the food on Yom Tov for Shabbat earlier in the day so that it will complete cooking well before Shabbat so that it’s possible it could have been used on Yom Tov. If it turns out that there’s not enough time to complete the cooking until right before Shabbat, if it’s Yom Tov Sheni one may be lenient, but if it’s the first day of Yom Tov then one shouldn’t be lenient unless it’s a time of great need. However, some defend the practice to permit cooking until sunset of Friday. 
Who needs an Eruv Tavshilin
- Everyone should set aside an eruv and not rely on the rabbi's eruv unless he forgot.
- Even someone who is going to be at a hotel and not cook should still set up an eruv tavshilin since one is going to need to light candles on Yom Tov for Shabbat. However, if one is only setting it in order to light candles one shouldn't recite a bracha.
- Anyone eating in the same house only needs one eruv tavshilin.
- It is permissible to ask a neighbor to set up an eruv tavshilin for you but initially you should do it yourself.
Eating the Eruv Tavshilin
- Some have the minhag to eat the Eruv Tavshilin for Seudat Shelishit. 
- If the Eruv is eaten or lost one may not continue to cook on Yom Tov in preparation of Shabbat.
If one forgot to make Eruv Tavshilin
- There’s a mitzvah to make an Eruv Tavshilin upon each individual and also upon the leader or Rabbi of the city on behalf of the whole city. 
- If one forgot, was unable, or didn’t know how to make Eruv tavshilin, the first time one may rely on the Eruv Tavshilin of the Rabbi of the town. However, if one had the ability but wanted to rely on the Rabbi of the town or if he forgot twice, he may not rely on the Rabbi’s Eruv.  If one is a visitor to the town and arrived in the town right before Yom Tov after the rabbi already made an eruv tavshilin, and one forgot to make an eruv, some say that one might not be able to cook.
- If one didn’t make Eruv Tavshilin according to some poskim one may not light Shabbat candles on Yom Tov which falls out on Friday. Therefore, in such a case one should give the candles to another Jew and let them light for him or only light one candle. 
- If Yom Tov (excluding the two days of Rosh Hashana) falls out on Thursday and Friday, and one forgot to make Eruv Tavshilin before yom Tov one may make Eruv Tavshilin on the first day and stipulate “If today is Yom Tov then there’s no need for an eruv and if today isn’t Yom Tov then the eruv should be set aside in order to permit cooking and baking.” 
- Some say that it’s preferable to make such a stipulation while others say that in such a case it’s better to rely on the Eruv of the Rabbi of the town. 
- Article on Eruv Tavshilin on Chabad.org
- Article on Eruv Tavshilin by Rabbi Yonason Sacks
- Ten Minute Halacha Eruv Tavshilin by Rabbi Aryeh Lebowitz
- S”A 527:1, Kitzur S"A 102:1
- Laws of Yom Tov (Rabbi Simcha Bunim Cohen, pg 279) quoting Sh"t Chaim Shaal 29
- Shulchan Aruch and Rama 527:12, Kitzur S"A 102:1. See Chazon Ovadyah (Yom Tov pg 294) who leaves out the text ולאטמוני and לנא ולפלוני ולפלוני או לכל בני העיר הזאת.
- S”A 527:2
- S”A 527:4, Mishna Brurah 527:11
- S”A 527:2
- Mishna Brurah 527:7
- Mishna Brurah 527:6
- S”A 527:3 writes that the baked and cooked dish should be the size of a Kezayit. Rama 527:3 adds that the bread should preferably be the size of a Kebaytzah. Kitzur Shulchan Aruch 102:1 agrees. Mishna Brurah 527:8 adds that it is a Hiddur Mitzvah to use a whole loaf of bread and significant piece of meat or fish.
- Ran (Beitzah 9b) explains that the rabbis only permitted cooking with an eruv tavshilin on Friday for Shabbat since that food is prepare for a more immediate use than if it was cooked on Thursday. Shulchan Aruch 527:13 codifies this halacha. See the Rash Mrovzavitz (cited in Yalkut Mefarshim of Oz Vehadar on Rif p. 69) who suggests that according to Rav Chisda (Pesachim 46b) this would be a Biblical prohibition.
- Mishna Brurah 527:3.
- The Gemara Pesachim 46b discusses why on a Biblical level it is permitted to cook on Yom Tov for Shabbat. Rabba explains that it is because one's cooking is permitted on a Biblical level if potentially guests could have come to eat it. Rav Chisda explains that Biblically it is permitted to cook from Yom Tov for Shabbat. On a rabbinic level an eruv tavshilin is necessary as the gemara Beitzah 15b explains either to ensure that there is enough food on Shabbat or to protect the kedusha of Yom Tov.
- Piskei Teshuvot 527:3
- Rosh (Beitzah 2:3). The Haarot of Rav Elyashiv (Beitzah 16b s.v. posheh) explains that it isn't permissible initially to set up an eruv because one should really have their own cooked dish set aside for Shabbat and Yom Tov.
- Chazon Ovadia (Yom Tov p. 276), Yalkut Yosef 527:4
- Yam Shel Shlomo 2:10, Chazon Ovadia (Yom Tov p. 276), Yalkut Yosef 527:3
- Kaf Hachaim 527:57 based on the general principle of doing mitzvot yourself (Kiddushin 41a). See however, the Haarot of Rav Elyashiv (Beitzah 16b s.v. posheh) who seems to allow this even initially.
- Mishna Brurah 527:11, Kitzur Shulchan Aruch 102:1
- Shulchan Aruch 527:15
- Shulchan Aruch 527:7
- Shulchan Aruch 527:7, Mishna Brurah 527:22
- Haarot of Rav Elyashiv (Beitzah 16b) explains that if one only arrived after the rabbi already made the eruv he wasn't included in the eruv unless the rabbi specifies the people who will come after he makes the eruv.
- Shulchan Aruch 527:19
- Mishna Brurah 527:55
- S”A 527:22
- Piskei Teshuvot 527:21