1. Disconnect the negative battery cable.
2. Remove the headliner.
3. Disconnect the connector.
4. Remove the screws, and then remove the sunroof motor.

Sunroof unit disassembly/assembly
Sunroof motor installationMazda 6 Service Manual: Dtc c1095, c1096
Caution
When attaching the tester lead to the DSC HU/CM connector the SST
(49 G066 004) must be used.
Diagnostic procedure
...
Mazda 6 Service Manual: Panel light control switch removal/installation
1. Disconnect the negative battery cable.
2. Remove in the order indicated in the table.
3. Install in the reverse order of removal.
Panel Light Control Switch Removal Note
1. Insert your hand from the lower side of the dashboard and squeeze the tabs
of the panel light control switch.
2. ...