I spray some neem oil on the soil, where the gnats would fly away or jump around (the small ones can't fly). It does kill some of them. For it to be effective, you need to spray a large amount or drench the soil, which might be too costly if you buy commercial neem pesticides.