Keep soil dry: Fungus gnats seek out moist soil, so allowing your houseplants to dry out a bit between waterings can slow down or stop an infestation. Let the top inch or two of soil dry out before watering again, and try to go as long as possible between waterings. Gnats may be deterred from laying their eggs if the soil is dry on the surface.