Ants in your garden are more of an annoyance than a harmful pest. Some ants bite and sting, while others can indirectly harm plants because they farm and protect aphids for their sweet secretions. Spraying insecticides is one way to kill ants, but many chemical sprays contain chemicals that are toxic to humans and animals, especially if they're applied to food plants. To kill ants in your garden, you need to give the ants poison they will take back to their nests, and get rid of the aphids that attract them.
Spray aphids with a homemade insecticide that won't harm people or your plants. In a spray bottle, mix a spoonful of vegetable oil, two spoonfuls of baking soda, 5 to 10 drops of dishwashing liquid, and 10 drops of peppermint oil. Spray this onto the aphids to kill them. The peppermint oil in the mixture will help keep ants from coming back because they don't like the smell.
Make a homemade ant hotel with borax and sugar. Poke holes in some small plastic containers with lids. The holes need to be just large enough for ants to get into and out of the container. Put the holes along the sides of the container near the top and a few in the lid.
Mix a cup of borax with 3 cups of sugar in a dishwasher-safe bowl. Add just enough water to make it soupy, and add 2 tsp. of peanut butter. Mix it well.
Put the mixture into the containers to fill them about halfway so the mixture is under the holes in the sides of the container. Cover the containers and place them near anthills or places where you see trails of ants. The ants will take the poisoned sugar back to their nests, which will kill the colony.