Pests like hornworms can't stand the aroma of thyme, which is what makes it a great repellant. It also does well in dry and shallow soil, making it quite easy to grow.
Thyme spreads easily, so make sure to space the plants out so they don't interfere with the growth of other plants. Try creating a 'grassy' theme border around your veggie patch.
Ensure that there are always some bruised leaves on the plant, as this allows the chemicals and the aroma to be released, sending hornworms on their way.