Gnats are also deterred by the smell of white vinegar, which can kill them if it’s flushed down the drain where they live.