Tomato hornworms (Manduca quinquemaculata) are a serious problem for tomato growers. These caterpillars have a large appetite and can quickly defoliate a tomato plant. If you find hornworms in your tomatoes, simply pick them off and drop them in soapy water. However, if you find a hornworm with white oblong obtrusions, leave it!
The white obtrusions are actually the cocoons of a parasitic wasp. A female wasp has laid her eggs under the skin of that hornworm. As the eggs hatch the larvae actually feed on the hornworm insides. The larvae eat their way out of the caterpillar and spin the cocoons you see. Eventually adult wasps will emerge from the cocoons and the weakened hornworm will die.
The hope is that the emerging wasps will find other tomato hornworms to parasitize and you will have managed that pest. There are some generalist parasitic wasps that will provide that service for you. There is a braconid wasp, Cotesia congregates, that specifically looks for tomato hornworms. This small wasp has clear wings and as an adult they are nectar feeders. To persuade the wasps to stay in your garden you will need to have flowers. The small braconid wasps are attracted to small flowers like yarrow and small asters.
Instead of reaching for an insecticide for tomato hornworms encourage the ecosystem to assist you in managing that pest!