Yellow Sticky traps and don’t water till soil drys out a bit. I’ve had these problem before and found out I got them because too much heat and humidity they like hot temperatures and high humidity
The gnats are attracted to yellow so having sticky yellow traps around will catch them. They love moisture to lay their eggs. Can also provide a vinegar with a drop of dish soap trap will collect some, sometimes. They drown in it. Good luck and happy growing 🌱
I use a 1/4” of sand on the bottom of my pot, then Happy Frog and some other soil mixed in on top of that. I also let my plants dry out a little before watering again, making the roots grow and reach to get stronger. No gnat problem for me
Use the sticky strips Amazon has them for cheap i have some ladybugs in my tent what also can do is let SOIL dry out a bit larve love moisture also look up Bacillus thuringiensis Israelensis hope this helps