Gnats are attracted to the dampness of your plants, so you must pull back some of that temptation. Never over water and protect the soil. You can cover soil with objects such as gravel. Clean containers and remove dead plant debris. Finally, occasionally use watered down insecticide on your plants.