"You shall rejoice on your holiday." (Devarim 16:14)
It is a mitzvah to celebrate the holidays (Pesach, Shavuos, and Sukkos)
with meat, wine, fine clothing, and sweets. We should also help the poor
and the lonely to rejoice.
The main focus of this mitzvah is to rejoice in the opportunity to perform
mitzvos and to serve Hashem with joy (Rambam, Hilchos Sukkah 8:15).
The Sefer HaChinuch (mitzvah 488) explains that we need joy in our lives
just as we need food and sleep. Thus, the Torah provides us with
opportunities to rejoice so that even our rejoicing will be part of our
avodas Hashem, as the Mishnah teaches: "Do all of your activities for the
sake of Heaven" (Avos 2:17).
The Vilna Gaon explains that one should avoid all thoughts of worry,
sadness, or pain throughout all the days of the holidays.