The best time to prevent carpenter bees is during the spring when they become active. Implementing preventive measures before they establish nests can be effective. This typically involves sealing off or treating vulnerable wood surfaces to deter nesting.