If a person died on Shabbat or Yom Kippur, we do not deal with the burial on that day, nor may one move the body, as it is muktzeh. If there is a concern that the body will be degraded, we cover it with an item of clothing or another non-muktzeh item and thus move it to a place where it can be preserved with dignity (SA 311:1-4). A non-Jew may not be asked to deal with the burial, as it is rabbinically prohibited to ask a non-Jew to do something that would be prohibited by Torah law if a Jew did it. Desecrating Shabbat or Yom Kippur on behalf of the corpse is not respectful toward the deceased (SA 526:3).
On Yom Tov, in contrast, the Sages permitted asking a non-Jew to deal with the burial. The Sages here are following the lead of the Torah. Since the Torah is lenient in allowing one to do melakhot in order to prepare necessary food items on Yom Tov, the Sages too are lenient in allowing one to ask a non-Jew to do whatever melakhot might be necessary for the burial, including sewing the shrouds, making the coffin, and digging the grave. Furthermore, Jews may do rabbinically prohibited melakhot to facilitate the burial. These include washing the body, transporting it, escorting it (within the teḥum), and placing it in the grave. Non-Jews may then fill the grave with dirt (Beitza 6a; SA 526:1).
On Yom Tov Sheni and the second day of Rosh Ha-shana, the Sages allowed Jews to deal with the burial of the dead, for the Sages rendered Yom Tov Sheni as a weekday for everything needed to take care of the dead. Since the Sages are the ones who enacted the second day of Yom Tov in the Diaspora (as explained below, 9:2-3), they had the authority to permit melakha then, in order to prevent the degradation of the dead. Therefore, a Jew may sew the shrouds, dig the grave, and even cut myrtle branches to be placed on the coffin in those places where this is a standard way of paying respect to the dead (Beitza 6a; SA 526:4). Some say that when possible, a non-Jew should be asked to do the biblically prohibited melakhot (Rema, ibid.)
Anything that may not be done on Ḥol Ha-mo’ed for the deceased may not be done on Yom Tov Sheni either. Therefore, one may not do melakha publicly if onlookers will be unaware that it is for the sake of the dead. This includes engraving the tombstone and cutting down trees to make the coffin (SA 547:10; MB 526:24).
Even if the cemetery is beyond one’s teḥum Shabbat, he may still accompany the body there on Yom Tov Sheni. However, if it is necessary to drive in order to get to the cemetery, then the only people who may do so are those whose presence is required for the burial. The rest of the escorts, including mourners, may not go (SA 526:7; Oraḥ Mishpat §130; as for coming back afterward, see SA 526:6; MB ad loc. 35; BHL s.v. “ve-ḥozrin”).
If someone passed away on the first day of Yom Tov, the burial should not be delayed until the second day in order to allow Jews to take care of it. Be-di’avad, if they transgressed by waiting, Jews may perform the burial (SA 526:2; BHL s.v. “asur”). Some follow the practice of delaying burials le-khatḥila from the first day of Yom Tov to the second (Raavad). Nowadays in particular, when relegating the burial to non-Jews is considered very disrespectful toward the deceased, some are lenient and permit waiting. Those who wish to rely on this leniency may do so (see Piskei Teshuvot 526:3).
When there is a concern that if the burial takes place on Yom Tov, people will desecrate Yom Tov (such as by making phone calls to notify people of the time of the funeral, or by driving in order to participate), it is proper to delay the burial until after Yom Tov. This is especially true nowadays, when bodies can be kept refrigerated, thus minimizing the degradation. Anywhere that Jews are likely to desecrate Yom Tov because of the funeral, it should not be held on Yom Tov Sheni (Igrot Moshe OḤ 3:76).
Since a body can now be refrigerated so that it will not be degraded, it would seem that even when we are not concerned about Yom Tov desecration, the relatives of the deceased may choose to delay the funeral until after Yom Tov in order to allow more people to attend. True, there is a mitzva to bury the dead as soon as possible and not to leave the body unburied. Nevertheless, when delaying the funeral will result in a better-attended funeral, thus increasing the respect paid to the deceased, it is not prohibited (SA YD 357:1).