Removing moles does not usually prevent melanoma. Some moles can develop into melanoma, but this is unusual for normal moles and even most odd-looking moles. The best medical intervention for reducing the risk of melanoma in people with many moles is regular full-body skin checks by an accredited skin cancer doctor or dermatologist, possibly with regular mole mapping photography of the whole body to check for suspicious changes in the skin.
Moles are a common type of skin growth that are typically benign, or non-cancerous. Most melanomas are new (i.e. they are melanoma from when they first appear and less commonly develop from pre-existing moles). However, some moles can develop into melanoma, which can potentially be life-threatening.
The question of whether removing moles can prevent melanoma is a complex one. In general, removing normal moles does not prevent melanoma. However, removing dysplastic (abnormal-looking) moles that are suspicious or at high risk for becoming cancerous could potentially help to prevent the development of melanoma. Unfortunately, there's no reliable way of knowing which dysplastic moles will develop into skin cancer. There's no clear way of knowing exactly which moles to remove to prevent melanoma, and even removing multiple moles (e.g. multiple surgical mole excisions or removing multiple moles with a laser) does not appear to reduce the risk of melanoma developing later.
The best way of reducing the risk of melanoma is to reduce ultraviolet exposure from sunlight, especially at a young age. Unfortunately, this is no longer possible for most people and other melanoma risk factors such as family history and having multiple moles can't be controlled.
People at high risk should reduce their risk of developing serious melanoma by having regular (usually yearly) skin cancer checks by an accredited skin cancer doctor, dermatologist or experienced skin cancer nurse. For people with multiple moles, regular total body mole mapping photography may be a useful way of detecting changes in moles and the development of suspicious new spots.