Ants are just looking for a meal, and in your garden, that meal is usually provided by other bugs. If you stop the aphid buffet, the ants will pack up their tiny picnics and leave. So, blast those aphids off with a strong spray of water from your hose. Do it every morning for a week; it’s surprisingly satisfying.
You can also use a mild soap spray (one teaspoon of dish soap per liter of water) on the infested plants. Just be careful not to nuke the bees—spray in the evening when they’ve clocked out. If you see ants crawling on a specific plant, check the stems for sticky residue. That’s the honeydew; you are looking at a crime scene.