Certain forms of contraception, such as oral contraceptive pills, have been shown to reduce the risk of ovarian and endometrial cancers. However, it is important to discuss the risks and benefits with a healthcare provider to make an informed decision.