A process that is carried out at the cellular level which results in the assembly, arrangement of constituent parts, or disassembly of a melanosome. A melanosome is a tissue-specific, membrane-bounded cytoplasmic organelle within which melanin pigments are synthesized and stored.