The fungus gnat will search out moist soil to lay eggs and when the eggs hatch the larvae will nibble on the roots of the plants. Fungus gnats are more annoying than harmful, and plants that are well established may not be effected but new seedlings and smaller plants can be damaged if the infestation of the gnats is large enough. Fungus gnats are drawn to moisture and if the soil appears to be too moist, skip watering until the soil drys out. Gnats will not be drawn to dry soil and will look for another place to lay their eggs.
To trap the gnats, sit a few dishes of water around your seedlings with vinegar and a few drops of dish soap. The vinegar will attract the gnats and the dish soap will weight them down, drowning the little pests. You can also take a bright yellow piece of paper as the gnats are drawn to this color and smear it with petroleum jelly. Attach the paper to a Popsicle stick and stick it close to your plant or hang it in the area where the gnats are most actively flying around. When they bump into the jelly they will get stuck and die.
You can also sprinkle cinnamon over your seedlings as this is natural fungicide. Other home remedies you can use to kill larvae on your plants is 1/4 cup of rubbing alcohol mixed with 1 cup of water and 1/2 tsp. of dish soap. Put these ingredients in a spray bottle and spray your plants liberally. You can also dilute 2 tbls. of Cheyenne pepper in 1 cup of water and spray your plants.
After spraying plants, wait several hours, then take a clean sponge or cloth and wipe your leaves to remove dead larvae and gnats. Keep a pan of hot soapy water on hand, rinsing the leaves as you go and be careful you do not spread the pests to other plants while washing the leaves.