The best way to prevent melasma is to limit skin exposure to the sun. If you go out in the sun, take these preventive measures:
Wear a hat with a brim to shade and protect your face.
Apply sun block (such as zinc oxide or titanium dioxide) to vulnerable areas.
Use sunscreen that protects against both ultraviolet A and ultraviolet B radiation. The sunscreen should have a sun protection factor (SPF) of at least 30.
When to See Doctor
Consult a doctor if the dark spots dont go away and gets more pigmented such as your nipples, freckles, scars, and the skin of your genitals becomes even darker during pregnancy.