Some people believe you can't get rid of them yourself, but you need to call an exterminator.
Others use a product purchased at Home Depot or similar store, which is a small bottle of carpenter ant liquid concentrate killer that you mix with water in a pump sprayer.
One such concentrate is made by the Zap pest control Company and the proportion of mix to water is:
1/2 fluid oz to 1 gal. water for carpenter ants, crickets, etc.
1 fluid oz to 1 gal. water for roaches, fleas, spiders
Follow the directions on the label. This can be used indoors or outdoors.
It is also noteworthy that mother nature uses insects to compost dead wood and most human dwellings are made of biodegradable materials, such as wood. The carpenter ant does not generally start attacking strong wood, but the already weak parts assisted by water damage (such as leaks in the roof, sinks, water areas of a house, tree stumps outside), so finding the ants will show the homeowner early water damage.
Homeowners can actually get two products that work well enough that you might not really know where the colony is and still get rid of them. One is Advance Carp Ant Granules, the other is Max force Carp Ant Gel. I find ants are more found in just hollow areas in the structure rather than actual wet wood, though looking for damaged wood from water or termite would be a good start.