I'd imagine the old one should pop out by levering out softly with something like a plastic spatula (Plastic tool less likely to damage surrounding B-Pillar trim or carefully use a flat head screwdriver or similar if spatula not handy). Then it should be connected via a small plug connecter from the wire.
Not replaced this myself so someone please correct if i'm wrong.