Former pest elimination salesperson here;
1. If they are the small 'pavement ants' you see making little hills on the sidewalk (hence their name) those are just a nuance than anything else. Generally they are attracted indoors due to access to water or food. Address any leaky pipes and clean up food debris, don't leave food out or not in sealed containers. Generally some spraying and putting a chemical barrier up will dissuade them but worse case you'll need a company as a colony can be up to 100,000 ants.
2. If they are the large black ants (carpenter ants) then you got a real problem most likely. They nest in the wall voids, literally chewing though the wood of the studs to make their home (hence their name). They leave behind frass (sawdust) by the holes they make. Over time they can cause significant damage to the studs, house structure. I know of some folks who let the infestation go on for several years and by the time they addressed it an entire wall needed to be replaced due to the damage. A colony can get up to 5,000 or so. If these are the ants you see spraying isn't going to fix it, you need to attack the nest, which you will need a tech for as they need to locate which wall void it is and shoot it full of whenever the current dust agent is they use now. (Back in my day is was professional grade dursban dust not the over the counter one you get now).
Also last note, make sure you hire a pest ELIMINATION company NOT a control company. Elimination company will come once, maybe twice at most to attack the source. Once they are gone you shouldn't need them again unless a new infestation happens. A control company is more interested is having you sign a monthly contract where they spray every month. They are not interested in killing the source more so putting up a barrier between you and the pests. Out of sight, out of mind. However the pests are mostly still there and in the case of carpenter ants still doing damage you just don't see them in the house for the most part.
Hope that helps, good luck.