The Gemara (Sukkah 37b) teaches that one may not smell the hadassim on Sukkos as it is designated for a mitzva. Hadassim are primarily used for fragrance and so are muktza to smell. Esrogim, primarily used for food, are muktza to eat. This applies throughout Sukkos, even on chol hamoed.
Nonetheless, the Shulchan Aruch (OC 653:1) extends the prohibition to smelling esrogim, too, as there is a machlokes about reciting a bracha on its fragrance while it is being used for a mitzva. As one could be making a bracha l’vatala by saying the bracha or benefitting without a bracha by smelling it without reciting one, it is best to avoid smelling the esrog.If one has hadassim or an esrog that one isn’t using for a mitzva (e.g. it isn’t Kosher or following Sukkos), one may recite a bracha on its fragrance. Before smelling hadassim one says “..borei atzei besamim.” Before smelling an esrog one says “..asher nasan reiach tov bapeiros” (Mishna Berura 216:9).