The answer to 'how to kill carpenter ant' is to use a combination of baits, sprays, and physical removal methods. Carpenter ants can be difficult to eliminate, so it's important to take a comprehensive approach.
First, identify and eliminate any sources of moisture that are attracting the ants, such as leaks or excess humidity. Then, use a carpenter ant bait or gel to target the colony. Apply the bait along baseboards, in cracks and crevices, and near any visible ant trails. The ants will take the bait back to the nest, helping to eliminate the entire colony. You can also use a residual insecticide spray in areas where you've seen the ants, which will kill any foraging workers on contact.