It's that time of year when no matter how diligently I clean my kitchen, how strict I am about not leaving food out, and how often we put out the garbage, the fruit flies descend and take over our space. I hate fruit flies. I learned this trick a few years ago from Angella and it saves my sanity every August.
Mix together 2 Tbsp white sugar, 2 Tbsp white vinegar, a few drops of liquid dish soap, and 2 cups of water. I like to mix mine up in a pie plate so there's a lot of surface area for the infernal insects to be attracted to (and then die in. Haaaaate fruit flies.)
The fruit flies are attracted to the smell of the vinegar and sugar (combined they smell like rotting fruit, though the scent isn't strong enough to be noticeable or annoying to us) and the dish soap changes the surface tension of the water so the fruit flies can't escape. Or something science-y like that. All I know is that it works.
I switch my traps up every twelve hours or so but they seem to be effective for longer if you can stand to have a container of dead fruit flies sitting on your counter.