Black spots are quite annoying, we call these melasma.
Sunblock is the best way to prevent them.
Once they have started, you can try some special creams to try to “lighten” them, but unfortunately might not work very well.
Other options might include “laser” treatment.