Sewer flies, also called fungus gnats, are tiny flies often confused with fruit flies. Sewer flies like to lay their eggs in the soil of indoor plants, especially during the fall and winter. Although sewer flies are beneficial outdoors because they eat decayed organic matter, they are a huge nuisance indoors. Fortunately, unless the sewer flies are present in very large numbers, they are generally harmless to the indoor plant. They are rather easy to remove.
Allow the soil in your indoor plant containers to dry between each watering. Be sure all of your planting containers have drainage holes in the bottoms, and never allow the bottom of the container to sit in water. Plant indoor plants in a good-quality commercial potting mixture. If you have indoor plants infected by root rot, get rid of the plants or try planting them in a fresh pot with new potting mixture.
Purchase some yellow sticky tape at a garden supply store and put the tape on the soil of infested plant. The yellow color will attract the sewer flies, and the sticky tape will trap them. Replace the tape every few days.
Put a potato slice on the surface of the potting mixture. The sewer fly larvae will attach themselves to the potato, and after three to four days, you can pick up the potato and dispose of it, along with the larvae.