Fill a small jar with 1/2 inch of apple cider vinegar or a 1-inch slice of banana. Alternatively, you can use 1/4 cup of warm water and a packet of yeast. Place a plastic sandwich bag or piece of plastic wrap over the jar, and secure it with a rubber band. Within a week, discard the trap and all its contents outdoors, and repeat the process, if necessary. This trap is effective in killing fruit flies.
Place yellow sticky fly traps around near where you see the flies, per label instructions. Some traps, for example, have a string so you can hang it, such as from a plant hook. Some sticky traps are sticky only on one side so you can lay them flat, such as on a windowsill. Other yellow sticky traps have a base and can stand on their own. Yellow sticky traps can also kill other types of flies you may be having problems with.
Pour 4 cups of boiling water down drains where flies are breeding. This helps loosen up the organic matter that is attracting the flies. Scrub the drain with a stiff brush, if possible, or use a drain cleaner, following the directions on the label. This also works for other types of flies, such as drain flies.
Make some other changes to eliminate the flies in your home. Move ripening fruit to the refrigerator, or eat them before they overripen. Take out your trash often. If the flies are breeding in your potted plants, they may be fungus gnats. Change the soil, and let the soil dry out between waterings.