Fruit flies are those tiny flies you'll often find hovering over your fruit bowl or around your kitchen sink drain. While they don't bite or otherwise harm humans, they are rather gross, as they make maggots. Getting rid of them can be surprisingly difficult since they're so small. However, with a little effort, you can be free of them in no time.
To get rid of fruit flies, make your first step getting rid of what attracts them: food in which they can breed. Cover your fruit bowl or store your fruit in the refrigerator. Sweep up all crumbs and wipe down any counters that may have food residue on them. Clear your drain of all food, and make sure your trashcan has a lid. Discard any overripe fruit, especially bananas, as they are a fruit fly's dream.
Clean thoroughly to get rid of fruit flies. Wipe up spills right away, and wash your dishrags and dish towels frequently. Avoid leaving dirty laundry around when you have a fruit fly infestation. Never put garbage of any kind in your waste-paper baskets. Clean the seals of your refrigerator and under and around your stove and dishwasher.
Once you've cleaned up and made your home inhospitable to fruit flies, it's time to get rid of those that have already invaded. Spraying isn't your best bet, as you'll probably end up spraying your dishes, food, and food-preparation surfaces too. Instead, use a trap.
One trap that may help you get rid of fruit flies involves a bowl, plastic wrap, and balsamic vinegar. Put a skinless piece of fruit in the bowl with the vinegar; make sure the fruit is old enough that it's beginning to rot or is at least on the verge of doing so. Cover the bowl tightly with plastic wrap, and don't leave any creases. Then, use a fork to poke small holes in the plastic. If the holes are small enough, the flies will get in, but they won't be able to maneuver back out again.
You can also use a bottle trap. Start with a large, plastic soda bottle. Pour in some vinegar (a funnel may help) until the bottom 1 inch (2.54 centimeters) or so is covered. Then put a couple of drops of dish-washing liquid in the vinegar. When your tiny pests try to land, they'll get stuck in the liquid. Others will simply get trapped in the bottle.