Coffee grounds can’t kill ants but they hate it. Coffee grounds are also effective in deterring insects like slugs, mosquitoes, and wasps. Sprinkle it around your tomato plants to keep the ants at bay. Coffee grounds are also an excellent source of nitrogen which makes them both an insecticide and a fertilizer for plants.