On hot, still summer days, swarms of flying ants become a nuisance, but they are not forming a new colony so please don’t destroy them. In fact, they are preparing to leave the underground nests you may not have noticed, under paving, in flower beds and in lawns, and fly away.

They are the young queen ants and male ants who, for a few days a year, disperse to mate with ants from other colonies. The males quickly die if they are not eaten by the birds that flock to feed on them. The queen then sheds her wings and digs a new nest in another location. The ants we see the rest of the year are female workers, gathering food for the colony.

The common garden ant is the black ant, Lasius niger. It is harmless and cannot sting, and nests in dry soil. Less common is the yellow meadow ant, Lasius flavus, also harmless and it builds small mounds in lawns. Maybe you can tolerate an anthill in a wilder part of your garden.

To prevent ants coming into the house, remove any food source and then wash the floor to remove the trails of pheromones that they leave to direct other ants to the food.

Ants also do much good. They aerate the soil improving its structure, turning over as much soil as earthworms do, and recycle nutrients for plant growth. Reptiles, amphibians and birds like green woodpeckers, sparrows, starlings, wrens and robins all like to feed on them. And swifts, swallows and house martins rely on the abundance of flying ants to increase their bodyfat before migration.

Wasps are not much loved but play an important role in nature as predators and pollinators. The common wasp, Vespula vulgaris, hunts flies, aphids and other insect grubs, which they don’t eat themselves but carry back to the nest to feed to the larvae. The adult wasps are in turn fed a nutritious sugary solution produced by the larvae.

When larvae numbers are low in spring and late summer, the wasps seek out nectar on flowers and because wasps fly and forage at lower temperatures than bees, they are beneficial for pollinating crops that flower early in the year, or in years with poor weather.

At the end of summer, with no larvae left in the nest, wasps begin to bother us seeking out sweet foods – if you are eating outdoors you can distract them by putting out something sweet for them several metres away.

Wasps can forage up to half a mile away, so a wasp nest in the garden does not mean more wasps. The nests only last for one season, the worker wasps die in autumn and the young queens hibernate alone overwinter, often in log piles, flying off to create a new nest in spring.

Insects are food for bats, birds and other animals and we benefit from the many services that they provide, so let’s try to be tolerant and find ways of living alongside them.