Generally, wasps eat other insects and act as a natural pest control around your home. They tend to ignore humans but can become a problem when they build their nests around your house raising your concerns of stings. Knowing what attracts wasps can help you know what to avoid, discouraging visits from them.

...
Wasps are attracted to many different things.

Protein Foods

Wasps are often seen flying around trash cans and picnic sites in the warmer months of spring and early summer. This is because at this time of year wasps like protein-based foods such as meat and other food scraps. They look to places in which they have previously found food. Be sure to empty trash cans and cover compost piles to discourage wasps from returning. Also, keep pet food indoors when possible. Even if you remove these food sources, wasps will return to the site for a while looking for food, so be consistent with cleaning.

Sweet Foods

As spring and early summer turn to late summer and even fall, wasps no longer are attracted to protein-based foods. As their taste turns to the sweet, such as soda, fruit and fruit juices, the wasps will become more aggressive and more persistent. When you are outside, discourage wasps by keeping a lid on your drinks and a cover on your compost heap. Also, when drinking out of a can, it is a good idea to use a straw because wasps may enter your can unnoticed. If you have fruit trees in your yard, pick up fallen fruits as soon as possible.

Flowers

Wasps like to search flowers for nectar, another food source. Lots of flowering plants in your yard can bring the wasps swarming. Even without flowers, you may find curious wasps flying around you looking for nectar if you are wearing floral print clothing or bright colors. Likewise, if you are wearing sweet smelling perfumes, they will be attracted to the aroma. During the late summer and early fall, it is best to minimize the perfume you wear when spending time outdoors.