If you have an infestation you're going to need to take a few steps to get the populations down considerably.
First step is to just grab a vacuum and suck those little fuckers to a dusty end. Vacuum around the pots, near the soil surface... where ever you see them. It is best to do this while watering. When you flood the soil surface they are going to fly up in an effort to not be drowned; but you'll be waiting there with the vacuum on and the nozzle ready to take them away.
Mosquito Dunks or Bacillus thuringiensis isreali (Bti) is a natural bacterium that produces a larvacide which is toxic only to a handful of species of insect larvae including fungus gnats and mosquitoes. It is widely available in compressed circular pucks under the brand name Mosquito Dunks, sold in most home improvement centers. They also sell Mosquito Bits, which is the same thing and other brand is Gnatrol but these products are usually less available. If you get dunks you use them by soaking in a bucket of water over night and irrigating. This should kill most of the larvae.
Then of course you should have yellow sticky traps around and Safer brand or Gnat-Stix sticky traps in the containers. But it is hard to bring absolute elimination if you have a lot of plants, house plants, etc. Biological controls are really the best. I recently noticed herds of microarthropods (Hypoaspis I suspect) in my organic soil and consequently gnat populations have dwindled fantastically.