Manual Control Method. Fungus gnats thrive in wet soil, so a heavy infestation may be an indication of over-watering. Letting the top 1 to 2 inches of the soil dry out completely between waterings can help kill the larvae. Once the flying gnats hatch, you can trap them with yellow sticky tape.