To best combat fungus gnats, I recommend you:
1. Use yellow sticky traps where the adult fungus gnats will stick.
2. For the larvae and eggs, I recommend using nematodes, which you can order online, and they will eat the larvae and eggs of the fungus gnats.
With these two methods, I've been successfully combating them for years, and since then, I haven't had any problems anymore.