And why do you need to get rid of them (if it isn't inside your house)? Ants don't eat healthy, living plants and are generally harmless in the garden and can be beneficial. They can kill off harmful caterpillars and their tunnels help aerate the soil. "Tunneling ants turn over as much soil as earthworms do, aerating the soil and redistributing nutrients. Ants are also part of the world recycling crew: acting as scavengers, collecting dead insects and turning them into fertilizer" https://www.finegardening.com/ants-arent ... z49oxjjame
If you really need to get rid of them, here's some ways:
Ant control techniques fall in categories:
strong smelling stuff
: ants are repelled by strong smelling stuff. That includes aromatic herbs like mints (especially pennyroyal which is a very strong mint and essential oils like peppermint oil which are very concentrated), tarragon, bay leaves and others. Also onion, garlic, citrus peel, cayenne pepper, black pepper, cinnamon, basically anything strong smelling. Put it in your cupboards to keep ants out, around plants where ants are cultivating aphids, around the cracks in your house where ants get in.
: theoretically at least ants don't like to walk over powdery stuff, which gets in their spiracles (breathing passages) and clogs them up. This includes flour, powdered chalk, talcum powder etc. But you have to put it down pretty thickly. If it is outside it will have to be renewed after rain. Diatomaceous earth sort of fits in this category, but it is unique, because on a micro level the particles are very sharp and cut the insects who crawl over it.
: ants don't like to walk over really sticky stuff. This includes vaseline, sticky tape, adhesive contact paper folded sticky side out, etc.
: classic is borax mixed with sugar, also baking powder and sugar.
Pour (a lot) of boiling water down into the ant hill when you find it.