Correction: An earlier version of this story blamed bees for stings that were probably caused by yellow jackets. The story has been updated.

Bright flowers attract bees. They sometimes mistake bright clothing for flowers. (blackjake/Getty Images)

I did something stupid last spring. After I returned from a long walk, I noticed what looked like bees flying around a small hole in the ground. Without thinking, I picked up a small rock and tossed it at the hole to see if I could make a “basket.” Two seconds later, the buzzing insects came after me like a squadron of jets attacking Godzilla. By the time I got into my house, I’d been stung three times and confessed to my wife that she married a knucklehead!

Bees and wasps usually don’t go out of their way to sting you. In most cases, they sting humans because we’ve threatened them. What I encountered were probably yellow jackets, which are wasps and are very protective of their nests. One of my patients went outside without shoes and got stung when she accidentally stepped on a bee. Another one got stung at a picnic when he reached into his back pocket for a napkin and found a bee (or possibly a wasp) instead.

Bees are attracted to bright colors and certain smells. In most cases, they set their sights on flowers. However, they will investigate a human if you resemble a flower. Brightly colored clothing and sticky hands are perfect triggers for busy bees. Yellow jackets are attracted to human food and sugary drinks.

The best way to avoid getting stung is to keep your hands and face clean when you’re outside and to be watchful if there are any bees or wasps nearby. But it’s generally not a good idea to swat at them, because they may sting you in self-defense. (I suggest not throwing rocks at them as well!)

A sting can be much worse for the bee than for you. In honeybees, the stinger is torn from the insect’s body when it pulls away from you, killing the bee. (Wasps and bumblebees, however, keep their stingers.) It’s important to see whether the stinger is still in your skin. You shouldn’t remove the stinger with your fingers or a pair of tweezers because you could end up pushing more venom into your body.

The best way to remove a stinger involves using a credit card or similar object. First, place the card against your skin at an angle. Next, push the card toward the stinger to gently detach it from your skin. (The movement is similar to the way you shovel snow from a sidewalk.) Because it’s upsetting to be stung, it’s best if an adult removes the stinger for you.

Once the stinger has been removed, or if it wasn’t there in the first place, wash the area with soap and water and apply ice to reduce the swelling. You can also take pain medicine if needed, with a parent or caretaker’s help.

It’s common for bee stings to become swollen. The swelling can last for a few days. If the area becomes redder and more painful, call the doctor to make sure it hasn’t become infected.

Some people are allergic to bee stings. They may get hives, a rash that is treated with antihistamines such as Benadryl. If someone develops signs of a more severe allergic reaction (swollen lips, difficulty breathing, chest tightness, etc.), an adult should call 911 for urgent medical attention.

Bees are wonderful creatures that are essential for the ecosystem, because they pollinate plants. They also produce honey and beeswax that enrich our lives. Wasps pollinate and help get rid of other insects. In most cases, if you don’t bother them, they won’t bother you.