Many causes of cancer are environmental, largely from tobacco, excessive sun exposure and workplace hazards such as chemical solvents and fumes. Avoidance is the best prevention strategy here.
I never drink coffee and I only occasionally drink caffeinated teas. While caffeine can be a temporary chemical solution to your drowsiness, I don't believe it is the best strategy overall.