The herbalist will search the forest around the herbalists building for herbs that can be used for medicinal purposes. Herbs generally only grow in older forests, at the base of old trees.
If a citizen's health is not full, they will acquire an herb from a market or storage barn, and then take it to the herbalist - they will do this around 2 times per year, depending on their health. The herbalist will prepare the herb and increase the citizens health slightly. A herbalist must be working at the location to give the medicine to the citizen.
If a citizens diet is poor, taking herbs as medicine will make up for the lack of food variety.
It is advisable to have an additional herbalist in the busy center of your town, even when there are no nearby herbs to collect, so that your citizens don't have to walk to remote parts of your map when visiting the herbalist.