Fungus gnats feed on the fungi which decayorganic matter.
Fungus gnats emerge from the soil as adults. They are small thin and dark in color. They can run across soil plant and pots, and will fly to windows. They will also fly up and around people when the plants are disturbed by people. They are mostly a nuisance insect.
Eggs hatch in potting soil soon after plants are potted or repotted and the potting soil is watered. Since newly potted plants are often kept moist till they re-establish, the insect has time to complete its life cycle and emerge as an adult.
No insecticide is needed. Carefully dry out the potting soil without allowing the plant to wilt. This allows the immature insects and the eggs still in the soil to dry out and die.