Fruit flies are tiny little flies that are attracted by the fermentation of over ripe, fruits and vegetables, vinegar, fruit juices and yeasts that you might have sitting on your counter in the kitchen or pantry.
If you wish to make a trap to eliminate these little blighters, simply fill a jar with their favorite foods. Like vinegar, over ripe fruit etc. Insert a paper or metal funnel into the mouth of the baited jar. The flies will fly in through the funnel but will not be able to fly out which will help clear out your kitchen of these little pests.
Around your home there are several precautions that you can take to prevent the build up of these flies in your home. Promptly pick up fallen fruit or tomatoes from the garden and keep rubbish bags tightly sealed.
You can use sticky strips hung from the ceiling in areas near the kitchen to help catch fruit flies and other flying insects.