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 brake (disc) removal/installation
1. Remove in the order indicated in the table.
2. Install in the reverse order of removal.
3. After installation, depress the pedal a few times, rotate the wheel by
hand, and verify that the brake does not drag.
Disc Plate Removal Note
Mark the wheel hub bolt and disc plate before removal ...
Mazda 6 Service Manual: Cruise Control (Some models)
With cruise control, you can set and automatically maintain any speed of more
than about 25 km/h (16 mph).
WARNING
Do not use the cruise control under the following conditions: Using
the cruise control under the following conditions is dangerous and could result
in loss of vehicle control.
...