Octopuses change color through special cells called chromatophores, which contain pigment and are controlled by the octopus's nervous system. When the octopus wants to change color, it can expand or contract these chromatophores to create different patterns and colors on its skin, allowing it to camouflage and blend in with its surroundings.