There is no specific medicine for melanosis, and there are many factors that can cause melanosis, including disease factors such as pancreatic cancer, advanced malignant melanoma, systemic lupus erythematosus, acanthosis nigricans, and drug factors such as long term use of chloroquine or hydroxychloroquine.
Therefore, treatment for melanosis needs to be tailored to the cause. For example, most hyperpigmentation due to drug causes will fade away when the medication is stopped.