It’s been more than a year since we sequestered ourselves to stay safe during the coronavirus pandemic. Now, with vaccinations underway and warmer weather arriving, you may be eager to do some socially distanced outdoor entertaining. Before you welcome guests, you need to get your backyard ready. Groom the lawn. Clean the patio furniture. Prep the grill. Check, check and check. But what’s your plan for dealing with uninvited guests? No, not that eccentric neighbor who shows up just as you’re starting to chow down. I’m talking about annoying pests such as mosquitoes, wasps, yellow jackets and flies. How do you ensure they don’t crash the party?

Keeping insects away from your home is easy. Keeping insects at bay without harming “good” bugs, not to mention pets and humans, is harder. Stinging pests can cause obvious injuries; others, such as flies and mosquitoes, may carry pathogens. Not every bug, though, is a bad bug. “Just because you can see it, doesn’t make it a problem,” says Angela Tucker, a staff entomologist for the pest-control company Terminix.

Many insects perform a service to the environment — including ladybugs, honeybees and other pollinators — and predator bugs, such as robber flies, eat other bugs. “Good bugs keep bad bugs in check. If you kill off all the natural predators, the bad ones will go out of control,” says Ryan Smith, an organic pest-control expert with Ant & Garden Organic Pest Control in Beaverton, Ore.

Unsure how to tell which is which? The website helps consumers identify pests and insects, and it provides tips for pest proofing and control. To learn which insects are indigenous to your area, contact your local county extension office. Typically run by universities or state agriculture departments, these offices offer free advice on gardening, pests and more.

For those willing to take the time, targeted pest control is effective and easy to do yourself (with a few exceptions, such as hornets’ nests). It can also save you money. Joe LaBrie and his family own Bug & Weed Mart, a company with five stores in the Phoenix area focused on DIY pest control. He says that before you buy any product, you should survey your yard or entertainment space to see what can be done reasonably without chemicals. Is there any trash or dog feces that needs to be removed? Are there nests being built that you can safely knock down? Can you store garbage and recycling bins elsewhere? Are certain spots prone to standing water that you can drain?

After you’ve assessed your yard, it’s time to focus on a specific pest. Each insect has different behaviors, likes and dislikes that should guide your approach.

Flies: Organic matter is catnip to flies, which are attracted to the odor. For family-style dinners, keep dishes covered, and only fill glasses halfway. You may even want to consider plating up indoors, then carrying your meal outside to dine, Tucker says.

One simple solution may be found in your pantry. Fill cups with vinegar (any variety) and place them every few feet around the perimeter of your space, Smith says. Flies are drawn to the scent, but vinegar is denser than water, so when the pests touch it, they get caught and drown. Another option: LaBrie suggests Fly Spot, an effective bait that attracts and kills flies in 60 seconds or less. Mix the product with water and spray flower pots, the backs of patio furniture and the bases of garbage cans.

Mosquitoes: Standing water is your biggest challenge, says Jim Fredericks, chief entomologist for the National Pest Management Association. Any container or object — toys, birdbaths, kiddie pools, flower pots, tire swings, gutter downspouts — that collects water needs to be dumped at least every five days, so mosquitoes have no breeding ground. For those who live in rainy locales, Smith recommends sprinkling Mosquito Bits into any standing water. These corncob granules are coated with a bacteria that quickly kills mosquito larvae but is safe for pets, birds and wildlife.

Considering bug zappers, torches or citronella candles? Most are pretty hit or miss. Tiki torches may dissuade mosquitoes because of the smoke, which throws off odor patterns, and the scent of citronella may act as a deterrent. But neither is an effective control method, Tucker says. As for bug zappers, remember that the electric chair of the insect world is indiscriminate in what it attracts, so both bad and good flying insects may be killed. And, as Tucker says, “placement is important, so when the insect gets zapped, no bug parts go flying out onto you or your food.”

An alternative to a traditional zapper is the DynaTrap Ultralight, which uses a motor and fan instead of an electrical current to do the deed. A fluorescent UV lightbulb and a titanium dioxide-coated surface that releases CO2 attract flying insects, and the fan pulls them inside the basket, where they die of dehydration. Then, you simply empty the trap as needed, LaBrie says. The DynaTrap will not harm honeybees, bumblebees or other beneficial insects, because they are not attracted to carbon dioxide.

Ants: Forget the chemical sprays and powders, which can be toxic to humans and pets. According to Smith, you can eradicate ants with a simple recipe. Mix one tablespoon of a peanut butter and honey mixture with ¼ teaspoon boric acid. Place blobs around your entertainment area (use a dish or paper towel if you’re concerned about protecting your floors) about one week before your event, and the ants should disappear. Not only is this concoction cheap to make — a bottle of boric acid should last you a lifetime — but it’s also safe for wildlife and pets, he says.

Yellow jackets, wasps and hornets: “Despite the instinct to do it yourself, removing stinging insects is not a DIY project,” Fredericks says. “Without protective equipment and training, you could end up getting in trouble. This is one time when you may want to call in a professional.”

Tucker agrees. “If you leave most stinging insects alone, they will leave you alone. Still, if they are nesting, have someone come out to remove it.” For very small nests, LaBrie suggests using Wasp-Freeze. The spray can travel about 15 feet, keeping you out of harm’s way while the residual insecticide eliminates the rest of the nest. Most paper wasps will relocate if you destroy their nests at an early stage.

Cicadas. Residents in about 15 states and the District are bracing themselves for the once-in-every-17-years emergence of Brood X. The cicadas will be a noisy nuisance, because males hoping to attract a mate emit loud calls that can reach more than 100 decibels. How do you control them? You don’t, Fredericks says. Cicadas don’t bite or sting. And although they may accidentally land on you, they aren’t attracted to humans or garbage. In fact, they serve as food for animals such as raccoons, foxes and birds. Essentially, they fly into trees, make a racket, mate, lay eggs and hatch into nymphs that burrow back into the ground for another 17 years. If they really creep you out, avoid hanging out in your yard between 10 a.m. and 5 p.m., when they’re most active. “Enjoy the entertainment knowing they’ll be gone by Fourth of July,” he says.