Getting rid of ants depends on the species of ants: They have different repellents, habits and food sources. Therefore, identify the type of ant infesting your home. Next, minimize the areas that draw moisture, and fix any water leaks around your home, because ants need it to survive. Keep your home as clean as possible, and eliminate any sources where ants can obtain food.
Next, cover up all small areas of your home to minimize the ants' access to it. Then use ant control bait, something they see as a new food source but contains poison like Borax. The ants take the food to its colony, and unintentionally poison the other ants. Additionally, spray vinegar in any small open spaces in your home, or on your kitchen counter. It removes the trail left by Odorous house ants, which they often use to signal to other ants how to move around your home.
Here are a few other ant eliminating solutions: corn meal, salt and flour, and chalk. Ants cannot digest cornmeal. If they eat it, their stomachs swell and they die. Flour and chalks create a threshold that ants refuse to cross. Draw a chalk line at an ant entry to repel them from entering your home. Additionally, add a trap for ants by placing tape, sticky side up, around food areas that attract ants, like cookie jars. It captures and kills them.