How do you get rid of fungus gnats?
To get rid of fungus gnats, you need to stop focusing on the flying adults and fix the overwatered potting mix where they breed. Let the top two to three inches of soil dry out completely between waterings to kill the eggs and larvae. For heavier cases, you can also water the soil with a biological treatment containing Bti.
What is actually going on
You water the monstera on Sunday, and by Wednesday evening there is a tiny dark speck drifting across the television screen. You wave it off. The next night another one floats past your face while you are brushing your teeth. When you finally nudge the plant pot, a small cloud lifts off the soil, hangs in the air for a second, and settles right back down like it pays rent.
Those are fungus gnats, and the way to get rid of them is to stop chasing the ones in the air and start fixing the pot they came from. That is the whole answer, and everything else is detail. The adults annoy you, but they are the harmless half of the problem. They do not bite, they do not feed on blood, and they do not carry disease. They spend their short lives looking for a mate and a damp place to lay eggs, and your overwatered houseplant is exactly the real estate they have in mind.
The real trouble is underground. In soggy potting mix full of decaying organic matter, the eggs hatch into larvae that graze on soil fungi and rotting bits of plant, and when the buffet runs thin they will nibble the tender root hairs of the plant itself. One generation follows another as long as the soil stays wet, which is why the swarm never seems to end no matter how many you swat. The whole cycle from egg to flying adult takes roughly three to four weeks at normal room temperature, so a pot can quietly produce wave after wave while you wonder where they keep coming from.
You might reasonably object that you already bought a pack of yellow sticky cards and caught dozens. You did, and it felt productive. But every adult stuck to that card had already laid its eggs, and the next batch was hatching in the pot while you admired your catch. Sticky traps are a decent way to monitor whether things are improving, but they are not a control method. To actually end the infestation, you dry out the top of the soil so eggs and larvae cannot survive, and in heavier cases you water in a biological treatment that kills the larvae where they live. Spraying an aerosol into the room knocks down an evening's worth of adults and changes nothing by morning.
How to tell for sure
Adult fungus gnats are tiny, usually somewhere between one sixteenth and one eighth of an inch long, with dark slender bodies, long spindly legs and threadlike antennae. The easiest way to picture one is a mosquito that shrank in the wash and lost its nerve. Their flight is weak and wandering, more of a clumsy flutter or short hop than a purposeful dart, and they usually stay close to the plant that produced them. They are also drawn to light, which is why they keep photobombing your screen in a dark room.
If you want to confirm the plants are the nursery, tap the side of the pot or brush a finger across the soil surface. A little cloud of dark flies rising off the potting mix usually settles the question. For firmer proof, scrape back the top inch of soil and look closely. The larvae are legless, translucent little worms, no longer than a staple, each one capped with a shiny black head that stands out against its glassy body. They wriggle when the light hits them. Finding those means you are not guessing anymore.
It is worth ruling out the usual impostors, because the fix for each is different. Fruit flies are usually tan and stouter, often with red eyes, and they care about your fruit bowl and kitchen trash, not your ficus. Drain flies have broad, fuzzy, moth-like wings and breed in the organic scum inside sink pipes. Phorid flies have a humpbacked look and tend to sprint across surfaces instead of flying off. If your tiny flies hug the soil line and the nearest lamp, fungus gnats are the likely answer, but the tap test and a peek under the surface beat any confident guess.
One more source worth knowing about: the bagged potting mix itself. Soil that sat outdoors in wet conditions at the garden center can arrive already carrying eggs or larvae, so a brand new plant in fresh mix can start an infestation all on its own. If a freshly repotted plant is the one producing gnats, the bag is a plausible suspect, and letting that soil dry out thoroughly before using it indoors is a sensible habit.
What usually comes next
So here is the decision that actually matters: you are going to change how you water, not what you spray. Let the top two to three inches of potting soil dry out completely between waterings. That dry layer makes the pot unlivable for eggs and freshly hatched larvae, and it breaks the cycle at the one point where you have real leverage. It sounds almost too simple, I know. There is a small irony in it too, because the cure for your gnat problem is the very thing your plants have been quietly asking for all along. Most houseplants suffer far more from kindness with the watering can than from neglect, and plenty of them will visibly perk up once their roots finally get to breathe.
While the soil dries, empty the saucers under your pots after every watering and give them a rinse now and then. A saucer that stays full keeps the bottom of the pot wet, grows its own film of organic scum, and calmly undoes all the drying you are managing from the top. This is also the moment to be honest with yourself about which plants actually need water. In autumn and winter, when the light drops and growth slows, most houseplants drink far less than they did in July, and a watering schedule you set in summer can keep soil soggy for weeks.
If the infestation is heavy, or you have enough plants that drying alone would take forever, pair the dry-down with a soil drench containing Bacillus thuringiensis var. israelensis, usually shortened to Bti. It is a naturally occurring soil bacterium, and when larvae swallow it, the proteins it produces kill them, while plants, pets and people are left alone when it is used as directed. One caution genuinely matters here: the same bacterial family has strains aimed at caterpillars, and those will do absolutely nothing to gnat larvae, so check that the label actually names gnats or this specific strain before you buy. Then mix and apply it exactly as the product label directs, as a soil drench rather than a leaf spray. Whether and when to reapply is a label decision too, so follow the interval the product gives you instead of any rule of thumb, because one pass rarely catches every hatching generation. Give the combination of dry soil and treatment a few weeks. The adults already on the wing have to live out their days before the room goes quiet, and no product on the shelf can hurry that along.
When to get help
Sometimes the plants are innocent. If you have dried out the pots, treated the soil, and small flies keep turning up in numbers that make no sense, the source may be structural rather than horticultural. A hidden plumbing leak, a cracked drain line under the slab, or a damp crawlspace can breed drain flies or phorid flies in places you will never reach with a watering can. That situation calls for a licensed pest control operator or a plumber who can find and fix the fault, because no amount of soil management touches a broken pipe.
The other case for outside help is scale. A commercial greenhouse, a big indoor atrium, or a bench full of delicate seedlings cannot always tolerate the dry-down that a mature monstera shrugs off, since young roots stress easily and larval feeding hits them harder. In those settings, a university extension service or a licensed commercial applicator can advise on biological controls such as predatory mites or beneficial nematodes, which hunt the larvae in the soil and suit plants that cannot afford to wait.
One last thing, said gently because it matters. Fungus gnats and other small flies do not bite people, and they do not burrow into or live on human skin. If someone in your household feels a persistent crawling or biting sensation when no insects can be found, that is not a pest problem, and no pesticide will fix it. The right call is a doctor or a dermatologist, who can look for the many ordinary skin and health causes behind that sensation. Treating the house for an infestation that is not there only delays the help that actually works.