Homemade fruit fly traps are designed to attract fruit flies, so it might appear at first as if they are bringing more fruit flies into a home. However, the traps are actually attracting flies that are already in the home. Once they are trapped, they can be eliminated.
The many different types of homemade fruit fly traps all follow a similar premise. First, something slightly sweet, such as a piece of a banana or a small amount of apple cider vinegar, is placed in a small container. Liquid can be added to encourage the fruit flies to drown.
The container should then be mostly covered using a piece of plastic wrap with small holes or a paper funnel. Once the fruit flies go in, they have no way to get out.