The chemical reactions and pathways involving mannitol, the alditol derived from D-mannose by reduction of the aldehyde group.