The most effective way to prevent chickenpox is through vaccination. The varicella vaccine is recommended for children, adolescents, and adults who have not had chickenpox. The vaccine is typically given in two doses, with the first dose administered at 12-15 months of age and the second dose at 4-6 years of age.