Gnat pest problem control always requires a multitask approach.
When looking for some temporary relief from gnats, it is better to use natural repellents, the same as for other nuisance pests.
But the most effective measures are sanitary and physical ones, first of all; that is prevention and mass trapping.
As for the chemical control, it has been proved relatively ineffective.
Actually, insecticides just reduce the number of adult flies.
Besides, there aren't any biological gnat control agents commercially available.
Gnat Trapping: 4 Effective Techniques to Use Immediately
Gnat Trap #1.
Take a 1-gallon plastic container and crack 4 eggs into it. Then fill this container with water, mixing thoroughly. After that, take the 2-liter plastic bottle and cut a few holes in the upper third of it. Next, fill ? to 1/3 with the egg-bait solution. Now hang this trap 2-3 feet above the ground and check it once a week. Remember that 2-week-old trap becomes ineffective. Simply remove the contents, clean, and refill.
Gnat Trap #2.
Find a used jar and fill it with vinegar, apple cider one in particular. Gnats love this scent very much! Now seal the lid, poking tiny holes with a nail. Leave this jar in your dining area and in the kitchen. In fact, why not make several jars and place them in multiple locations? The gnats will get a 'one-way ticket' to the jar. Once it becomes full of insects, dispose of the jar and say good-bye to your gnat problem. Regular white vinegar needs to be made more attractive to gnats with a few drops of lemon-scented dish soap. You may also chop a banana or just put its peels into the jar.
Gnat Trap #3.
Do not forget about your kitchen sink! Pour some vegetable or olive oil into it and this will catch all the gnats, hanging around garbage disposal or drain. The pests simply fly into the oil, but afterwards they cannot (1) free themselves from its stickiness or (2) just mate. If necessary, repeat the procedure several times in order to get rid of all gnats. Alternatively, you may pour ammonia into the sink and leave it for several hours to dilute. This method kills adult gnats, as well as their eggs and larvae, which are living inside. For those who don't like the specific smell, some baking soda, followed by 1 cup of white vinegar, is recommended. Once the mixture fizzes, let it sit for 2 hours before running water.
Gnat Trap #4.
This one deals with gnat-infested plants. Firstly, stop watering your own plant until the upper two inches of soil dry out completely. As a result, gnat eggs and larvae will die. Secondly, make a spray in a bottle: water and a few squirts of lemon-scented dish soap. Thirdly, spray the mixture all over the plant. Fourthly, leave it alone for an hour or two. Finally, spray your plant with plain water. If you notice gnats again, repot the plant with fresh soil.
Take these urgent measures, and remember to prevent your gnat infestation in prospect!