The bulb itself doesn't come out of there, rather there's a minimum of at least 2 connector harnesses that have to be unlatched. Follow the wires from the bulb up to the harnesses and unlatch them (nicely). Study how they clip together before you start trying to get them apart.
Every run of wire coming off that bulb has a harness that must be removed. Sometimes they are paired and sometimes they are separate.
The luck in this exercise is that the connectors are all made in ways that you can't attach the wrong ones together and blow up your ballast.