Yellowjacket ground nests
Nests in the ground can be controlled by placing an insecticide dust, typically containing permethrin, in and around the nest entrance during the night. The dust particles will adhere to the insects as they leave and reenter the nest and control will usually be achieved within a few days. Pouring a liquid insecticide into the nest entrance is less likely to be effective as the liquid may not reach the nest depending on where it is located within the burrow.
Concealed yellowjacket nests
Yellowjacket nests that are found inside homes in wall voids, attics, concrete blocks, or similar spaces are much more challenging to control. The most effective treatment is with an application of a dust, e.g. containing deltamethrin. Unfortunately, there are not many products like this available to the general public that are registered for use in buildings. An aerosol insecticide is not very effective. In fact, an aerosol spray can sometimes cause yellowjackets to look for another way out, which often leads them to the inside of homes. Also, don't seal the nest opening until you know all of the yellowjackets are dead as this can also cause yellowjackets to move into your house. It is usually best for a pest management professional to control hidden nests in buildings.