Follow the ant trail back to the nest. If the ants have built a mound, it will be obvious, but some species build nests in woodpiles or other less accessible locations.
Expose the nest by digging out the mound with a shovel or removing wood or other debris to uncover it. Boil one or two gallons of water in a cooking pot and pour it directly on the nest.This will destroy the colony and the queens. Alternatively, spray commercial insecticide on the nest. If you have a fire ant infestation, spreading worm castings on the mound will cause them to vacate the nest.
Bait the ants to avoid digging up the mound or otherwise finding and uncovering the nest. The ants will eat the bait and take it back to the nest and feed it to the colony, killing it. Use a commercial bait or make a non-toxic one yourself with boric acid and sugar.
Make a non-toxic ant bait by filling a 1-quart mason jar with about 2 inches of water. Mix in enough sugar to make a syrup, then stir in a teaspoon of boric acid. Roll up a piece of paper towel and put it in the jar so one end extends from the mouth. Set the jar along the ant trail so the towel is touching a wall or a tree that the ants can climb to get to it.
Mix 10 or 20 drops of peppermint or eucalyptus oil with a gallon of water and spray it around the yard with a garden sprayer every two weeks to keep the ants away. Ants dislike both substances and will avoid them. Alternatively, spread mint leaves around the yard periodically.