Some herbs can be invasive, such as bee balm, costmary, mint, and wormwood. These herbs spread by aggressive underground runners. These herbs can still be enjoyed and controlled if you plant them in a container, or barrier the roots can’t penetrate.
Find an old bucket or pot. You want to look for a pot that will not rot or break under the ground. Be sure it is at least 6″ deep, and large enough to accommodate the plant, at the size you want it to be. Since these herbs soot their runners out to the side, you can punch small holes in the bottom of the pot for drainage.
Dig a hole in the garden and set the container in place. Make sure the rim is an inch or two above ground level so the runners can’t escape. Set the plant in the middle of the pot, and fill the pot with soil. If you want to hide the rim of the pot, place a layer of mulch around it.
Other herbs can spread aggressively by reseeding themselves, such as dill, lemon balm, chives, and purple perilla. The only way to control the spread of these herbs is by deadheading, or removing the spent flowers before they have a chance to produce seeds.