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: Replacing Interior Light Bulbs
Overhead lights/Front map lights (LED type), Rear map lights (LED type)
The LED bulb cannot be replaced as a single unit because it is an integrated
unit. The LED bulb has to be replaced with the unit. We recommend an Authorized
Mazda Dealer when the replacement is necessary.
Overhead lights/F ...
Mazda 6 Service Manual: Key Battery Replacement
If the buttons on the transmitter are inoperable and the operation indicator
light does not flash, the battery may be dead.
Replace with a new battery before the transmitter becomes unusable.
CAUTION
Make sure the battery is installed correctly. Battery leakage could occur
if it is not in ...