Take a small glass, add some apple cider vinegar and a few drops of dish soap. They'll be attracted to it, land on the surface, and sink because the soap knocks down the surface tension.
Maybe a better recipe, but i've just used the vinegar and soap...
"For this method, you will need some apple cider vinegar, sugar, dish soap, water, and a container. In the container, mix two tablespoons of vinegar, 1 tablespoon of sugar, a few drops of soap, and 1 liter of water. Mix it well then place the container around the area where you see the most gnats. The insects get attracted to the smell of cider vinegar then succumb to their death when they touch the liquid mixture because of the soap. You may want to set up several small containers around the house to get a better idea of where the gnats are breeding."