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: Tire Inflation Pressure
WARNING
Always inflate the tires to the correct pressure: Overinflation or
underinflation of tires is dangerous. Adverse handling or unexpected tire failure
could result in a serious accident.
Use only a Mazda-genuine tire valve cap: Use of a non-genuine part
is dangerous as the correct tire ...
Mazda 6 Service Manual: Rear Cross Traffic Alert (RCTA) (Some models)
The Rear Cross Traffic Alert (RCTA) system is designed to assist the driver in
checking the area to the rear of the vehicle on both sides while the vehicle is
reversing by alerting the driver to the presence of vehicles approaching the rear
of the vehicle.
The Rear Cross Traffic Alert (RCTA) ...