Remove a houseplant from its pot; carefully dislodge potting soil from around the roots and rinse roots thoroughly. Bag the removed soil and remove it to an outside trash receptacle. Repot the plant in new, sterile potting mix.
Water the plant only as needed; do not overwater it. Allow the soil to dry thoroughly between waterings, especially the top 2 inches. Monitor the presence of larvae in the soil by placing a cut potato slice on top of the soil to see if larvae collect underneath the slice.
Place a yellow sticky card near the houseplant to trap gnats and reduce infestations. Throw the sticky card away when covered with gnats and after stickiness subsides. Replace with another card and continue trapping gnats until populations decline.
Purchase an insecticidal spray specifically formulated for houseplants that contain pyrethrin or pyrethroid ingredients. Follow the label directions exactly to kill fungus gnats. Use spray each time successive generations emerge from the soil until populations are under control.
Place a shallow tray of sprouted wheat near the plant as a trap crop on which female gnats will lay their eggs. Remove the tray to a plastic bag after two to three days. Place the tray in a plastic bag; seal and discard the bag outside in a trash receptacle. Repeat these steps until gnats are eradicated.