Getting rid of the adults is a snap: simply give them a sticky yellow surface to land on, and within a few days you'll have enough dead adults to make a tasty dinner of
gnat casserole (
YMMV).
The larvae are a bit trickier. The first step toward getting rid of them is to starve your plant of water for a few days, letting the top layers of soil dry completely. Larvae cannot develop in dry soil, though they can survive a
drought by suspending their development. Don't worry about killing your plant; it takes
serious dedication to kill most houseplants from underwatering, while
overwatering a plant can kill it very quickly.
Once the soil is dry, mix 1 part
hydrogen peroxide (H2O2) solution with 4 parts water. Use 3% solution, which you can find in any
drug store or in the hygiene/medicine aisle of a chain grocery store. You can use a stronger solution if you change the water mixture appropriately, and don't be too concerned with proportions; it would take a very high concentration of H2O2 to hurt your plants. Just
make sure you buy pure H2O2 with no chemical additives! Hydrogen peroxide is often sold as a
topical disinfectant, and things that are good for your wounds may not be so healthy for your plants.
Water your plants as you normally would, using the hydrogen peroxide solution and taking care to get good coverage of the entire top layer of soil. Use a
spray bottle if desired. The soil will
fizz for a few minutes after application; this is natural. The gnat larvae die on contact with the H2O2. After a few minutes the fizzing stops and the H2O2 breaks down into oxygen molecules (which your plants don't mind) and water molecules (which your plants love).
Congratulations! You've just successfully treated your fungus gnat
infestation. Monitor the gnat population for a few days with sticky cards, in order to make sure you've got them all. Make sure not to overwater, and consider sometimes adding a little hydrogen peroxide to your daily waterings--in my experience, the plants react well to this little
treat. Watch your plants grow big and strong and enjoy the fruits of your labors, whether they be flowers, vegetables, literal fruits, or
big sticky nugs of
homegrown chronic.