What is cancer?
Cancer is a cell desease that makes cells outgrow the space they're in, creating tumours. It's a desease that makes cell growth abnormal.
Where does cancer start, how does a cell become cancerous?
Cancer starts in the cells nucleus, more specifically in the chromosomes (logical since it's a desease related to a cells growth/reproduction cycle). There are three known ways that a cell can become a cancerous.
1 - It will suffer a mutation with a DNA "coding" error.
2 - Translocation fails, putting sets of genes in the wrong places.
3 - Self-copying error, either an excess or a dearth of replicas.
How to create a cancer-resistant cell?
So, the simplest way would be studying the options above, and see which one of those is the most common case (tracing the "origins" of cancer can be hard) and then try to modify cells to prevent it from failing.
The easiest way of doing so, will be studying the genetic fails and doing genetic modifications to the genes functionality. I personally do not think that's an option now, because playing around with cells isn't as safe as it looks. We would have to advance both in "cancer-knowledge" and technology to find a solution.
Hope it helped,
BioTeacher101