If you want to avoid melasma or have fears of its recurrence, then be careful with the following steps:
Limit your sun exposure time
Always wear sunblock with a high SPF
Wear hats and caps for sun protection