And is skin cancer hereditary?

Yes, like many other. Diseases. Just because a family member has skin cancer, it does not doom you to the same fate. Using good skin care with sun block & protective clothing will go a long way to reducing skin care risk. Smoking is an independent risk factor for many cancers...Quit smoking now to reduce your risk.