This might work: https://www.craftylittlegnome.com/fungus-gnats-houseplants/
A bowl of vinegar with a drop of dish soap. Cover with plastic wrap and poke a few holes.
These common pests came into your house on the fruits from the market. The gnats lay their eggs and when conditions are right, they hatch. To prevent this thoroughly wash them off and immediately refrigerate the produce, except bananas. Next is clean the sink drain with 1/2 baking soda followed by 1 cup of white vinegar, when the fizzing stops, rinse with a good amount of hot water, you may also want to keep the stopper in the sink drain until you have gotten rid of them.
Now for those hatchlings that are still buzzing around, take a sticky cardboard trap (you can get a pack of these from Walmart-they are in the pest control section). These are the same ones used to catch mice, lay it flat and peel off the protective layer, do not fold it up. Put a small piece of sweet decaying fruit in the center of it, the gnats will land on the sticky part and that will be the end of them.
Best to you.
Gnats are attracted to an thrive on moisture, so remove this from your home and you remove them. Make sure that your house plants dry out completely before rewatering them; make sure that pet water bowls are cleaned frequently and stay in one spot, and wipe down all sinks and tubs after use.