How can you avoid geting cancer?

Exercise, no tobacco. Avoid sunlight & tanning beds, maintain normal weight, moderate or no alcohol, avoid processed meats. Most important is don't smoke or use other tobacco products. Exercise may decrease the risk of colon and breast cancer. If you're a woman with a family history of breast cancer you may want to avoid alcohol. Processed meats contain cancer-causing chemicals. Protect your skin from sunlight.
Don't smoke. Smoking can cause many cancers, including lung cancer and squamous cell cancer of the esophagus.
Healthy lifestyle. Things not to do: avoid smoking and tobacco, avoid excessive alcohol use. Things to do: eat well, and exercise regularly, use good sun protection, and see your doctor for routine checkups. There is, of course, a large component of cancer risk due to your genes that you can't control.
Holistic consult. There are lots of information available on-line about holistic approach to avoid cancer. It would be a good idea to consult holistic doctor to weigh in the family history and your current health to make a customized plan to avoid getting cancer. Even alkaline water helps in clearing out free radicals which in turn cause cancer.

Related Questions

How can you avoid getting pancreatic cancer?

You can't. But possible to reduce the incidence, pancreatic cancer is lethal fortunately has low incidence compared to other GI tumors. Unfortunate truth can not prevent it but reduce the incidence, healthy life style, balanced food with regular exercises, avoiding chemicals, toxic substances, pushing diabetes (and its drugs) few decades by not becoming obese, avoid alcohol & drugs etc.