I have little fruit gnats that invaded my plants one day. It was from overwatering, but they are extremely tough to get rid of.
I have found the solution. You need to kill the gnats, and their larvae at the same time. I cover or surround my pots with sticky traps, and water with mosquito larvae killer that has been soaked into the water.
It's finally working!!! 🥳 🥳 🎉