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: Front seat disassembly/assembly
Warning
Handling the front seat (side air bag) improperly can accidentally
deploy the side air bag, which may seriously injure you. Read AIR BAG SYSTEM
SERVICE WARNINGS before handling the front seat. (See SERVICE WARNINGS.)
1. Disconnect the negative battery cable and wait for more tha ...
Mazda 6 Service Manual: Smart City Brake Support (SCBS)
The Smart City Brake Support (SCBS) system alerts the driver of a possible collision
using an indication in the display and a warning sound when the Forward Sensing
Camera (FSC) detects a vehicle ahead and determines that a collision with a vehicle
ahead is unavoidable while the vehicle is bei ...