It can be annoying to see a wasp while you are just trying to go about your day. Although it does not do much damage, it can still be annoying but you can actually deal with it by catching them.
To catch the Wasps, you will need a net. All you need to do knock a wasp nest out of a tree by asking on a tree, shaking a fruit tree or hitting a tree. Right after that, you will need to be quick. The nest animation will pop up for a short while and you will have a small window to net them.
Of course, if you miss it, you will get overtaken by the swarm and get stung. You can try to run and then catch them with the net but that is harder to do.
The easiest way to do it is to equip your character with the net first before approaching the net. Shake it and press A to net the wasp the moment you can.
After catching them, you can either sell them to the museum or the Nook’s Cranny or Flick.