How do I get rid of gnats living in the soil of my potted plant?

by Vwa23911465
I have an avocado tree growing inside in a pot by the window. When I water it I see these little gnat-like bugs running around in the dirt. I have no idea how to safely get rid of them and would appreciate any suggestions.

  13 answers