Rotting fruit is a common culprit, but it isn't the only one. Dirty dishes, trash bags with spoiled food, and even damp potting soil can cause gnats to congregate and drive you crazy. ... Kill individual gnats by employing a spray bottle filled with water, vinegar, and dish soap.