A lot of my patients have a difficult time seeing the difference between sun damage and melasma, so you are not alone! Sun damage has a smaller, more random pattern on the skin, and is generally more superficial, whereas melasma looks almost like a shadow and covers a larger area. When you actually see pictures (check some out online) you can tell the difference but it can be difficult without doing some research or having a professional diagnose you.
Sun damage can be more easily remedied than melasma, as there is not a "cure" for melasma. Melasma is hormone-induced, and sun damage is caused by previous years in the sun. You can certainly quiet the melanocytes that cause melasma to look more prominent with in-office treatments by a doctor (or experienced aesthetician), or you can use creams that contain retinols and hydroquinone.
Sun damage responds well to IPLs, lasers, or chemical peels on MOST skin types. As always, before signing up to receive any treatments, do your research and make certain your skincare professional is experienced. I hope this helps!