Gnats are attracted to sweet and fruity scents, as well as water and body heat. They can be found in gardens with fruit, vegetable, and flower plants, garbage cans, and around people and pets. To get rid of gnats, one method is to set a bowl near the infestation and pour apple cider vinegar, a teaspoon of sugar, and a teaspoon of dish soap into it. The vinegar will attract the gnats, while the dish soap makes the mixture too viscous for them to escape. Other methods include using yellow sticky traps, which are designed to attract and trap gnats, and placing candles in a candlestick partially filled with water to attract and burn or drown the gnats. To prevent gnats, it is recommended to harvest produce regularly and clear away overripe produce and organic waste, avoid overwatering plants, and keep the home dry and cool by opening windows, fixing leaks or damp, and using a dehumidifier if necessary.