In most cases, colon or ovarian cancers happen by chance; however, in some cases they are hereditary. It means that they are caused by genetic mutations (changes) passed down in families.
If you have direct family members who have had colon or ovarian cancer, you may be more likely to get it yourself. For ovarian cancer, you should consider also any women in your direct family who had breast cancer: the genetic mutations responsible for breast cancer can indeed cause ovarian cancer as well.
If there are cases of colon or ovarian (or breast) cancer in your family, discuss it with your doctor. He/she will be able to advise about your own risk of cancer. In some cases, your doctor may refer you to a genetic counselor: this is a specialist who can identify if you need to do genetic testing, to determine your risk of developing these cancers.