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: Scheduled Maintenance (Mexico)
Follow Schedule 1 if the vehicle is operated mainly where none of the following
conditions apply.
Repeated short-distance driving
Driving in dusty conditions
Driving with extended use of brakes
Driving in areas where salt or other corrosive materials are used
Driving on rough or muddy ...
Mazda 6 Service Manual: Engine oil replacement
Warning
Hot engines and engine oil can cause severe burns. Turn off the
engine and wait until it and the engine oil has cooled.
A vehicle that is lifted but not securely supported on safety
stands is dangerous. It can slip or fall, causing death or serious injury.
Never work around or ...