It's debatable whether ants are beneficial to gardens, or if they are simply pests that destroy vegetable plants. Garden ants are small, and may be either red or black. These ants can sometimes be beneficial to gardens, as they act as pollinators and can kill off harmful caterpillars; they are typically harmless and won't eat the vegetation. However, carpenter and fire ants are dangerous to both your vegetable garden and home.
Follow the ant trail back to where the main colony is located. Ant hills are sometimes within walls, siding or behind skirting boards.
Mix 1 cup of sugar and 1 cup of Borax in a large cup. Sprinkle the mixture around the ant hills and wait two days. The Borax will poison and wipe out the ants. If there are still ants around your vegetable garden, continue to Step 3.
Use bait inside your house if the same types of ants that are in the vegetable garden are inside your home. Purchase ant bait at any retail store; the ants that get the bait will bring it back to their nest.
Spray the outside of your home with insect repellent. Spray 2 feet up and 1 foot away from your home. Spray the door trims, cables, pathways and window sills. Continue spraying for a week until the infestation stops.
Treat your yard and the perimeter of your vegetable garden with granules and liquid bait. This should last around your garden for two to three months, but check every week to make sure the liquid bait hasn't dried up.