Preheat the oven to 350°F (175°C).
In a large skillet, melt the butter over medium heat and add the chopped onions and celery.
Cook until onions are translucent and celery is tender, about 5-7 minutes; then stir in the dried herbs, salt, and pepper.
In a large bowl, combine the cubed bread and the sautéed vegetable mixture.
Pour in the broth gradually, mixing gently until the bread is moistened but not soggy.
If using, gently fold in the dried cranberries or raisins.
Transfer the mixture to a greased baking dish and cover it with foil.
Bake in the preheated oven for 30 minutes, then remove the foil and bake for an additional 15-20 minutes until golden brown.
Let the stuffing cool slightly before serving.