How can I be sure what is causing the melanosis?

This is a very complex process that must be analysed through a combination of detailed history taking, observation of the distribution, pattern and extent of the hyperpigmentation, causes of aggravation, self-conscious symptoms, general condition and sometimes further dermatopathological examination and systemic systemic examination.