Some individuals inherit genetic mutations that increase their risk of developing certain types of cancer. For example, mutations in the BRCA1 and BRCA2 genes are linked to a higher risk of breast and ovarian cancer. Genetic testing can help identify individuals at increased risk, allowing for early intervention and preventive measures.