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: Outside Mirrors
WARNING
Be sure to look over your shoulder before changing lanes: Changing
lanes without taking into account the actual distance of the vehicle in the convex
mirror is dangerous. You could have a serious accident. What you see in the convex
mirror is closer than it appears.
Mirror type
Flat ...
Mazda 6 Service Manual: Inboard combination light removal/installation
1. Disconnect the negative battery cable.
2. Remove the trunk lid trim (liftgate lower trim). (See TRUNK LID TRIM
REMOVAL/INSTALLATION) (See LIFTGATE LOWER TRIM REMOVAL/INSTALLATION)
3. Remove in the order indicated in the table.
4. Install in the reverse order of removal.
Inboard Combinat ...