Some cancers have a genetic component, but are rarely entirely due to genes. For example, there are some families which carry genes that cause them to have a higher risk of breast or colon cancer, but not everyone in those families actually develops cancer.
In order for a person to develop cancer, one of the cells in their body must develop mutations that allow it to continue multiplying despite signals to stop, and also develop the ability to spread to other areas of the body. This is a complicated process, so even if it carries a gene that makes it easier to develop one of these properties, it still requires many more mutations to develop a true cancer.
To reduce your risk of cancer, it is very important that you do not smoke cigarettes and avoid exposure excess amounts of ultraviolet radiation (tanning beds and sunlight). These can cause mutations leading to cancer. You should also see a primary care doctor
to discuss your family history. He or she will inform you of screening guidelines for various types of cancer and how your family history changes when you should be screened. He or she can also determine if your history is significant enough that you should see a genetic counselor.