Removing moles does not usually prevent skin cancer. The most common skin cancers (basal and squamous cell carcinomas) and most melanomas grow from areas of normal skin. A small number of melanomas develop in pre-existing moles, but it's usually not possible to predict which moles will develop into melanoma, so removing moles doesn't ted to reduce the risk of future melanoma.
Removing a mole is unlikely to reduce the risk of skin cancer.
Some moles develop into melanomas, so preventing melanoma through mole removal would seem to be a logical strategy. However, most melanomas are new growths developing in normal skin. Abnormal-looking or "dysplastic" moles (often with multiple colours, irregular shapes and looking different from other moles) are often removed by skin cancer doctors, not necessarily to prevent melanoma from developing, but because they might in fact be melanomas. The mole needs to be removed so that it can be biopsied, and in case it's a melanoma, it should normally be removed in full so that it's unlikely to grow back after removal.
If the biopsy confirms a dysplastic mole, this does not always mean that a melanoma has been prevented since most dysplastic moles don't ever develop into melanomas.
There's no evidence that removing multiple moles reduces the risk of melanoma in high risk patients.
Squamous cell carcinoma, a common and potentially dangerous form of skin cancer, does not develop from moles. However, some solar keratoses (usually rough pink flat spots in sun-exposed areas such as the face, hands and forearms) develop into squamous cell carcinomas 1-5% of the time. Even though most solar keratoses don't develop into squamous cell carcinoma, it's quick and easy to treat them with cryotherapy (freezing) or a prescription cream.
Basal cell carcinoma, the most common and one of the least harmful skin cancers, grows in areas of skin that have been exposed to the sun. They don't grow from pre-existing moles or other skin lesions, so they can't be prevented by removing moles. The best way of preventing basal cell carcinomas is by minimising exposure to UV radiation, but in some cases oral vitamin B3 (nicotinamide) can significantly reduce the risk.