1. Detach the clips which secure A and B sections of roof molding, using a screwdriver or equivalent tool.

2. While pulling the roof molding up, detach the fit for the T stat of the A section and the roof molding and then remove the roof molding.
Rear beltline molding installation
Roof molding installationMazda 6 Service Manual: Illuminated Entry System
When the illuminated entry system operates, the overhead lights, the courtesy
lights, and an ambient light* turn on in the following conditions:
The driver's door is unlocked after the ignition is switched OFF.
The ignition is switched OFF with all doors closed.
NOTE
(Overhead lights) ...
Mazda 6 Service Manual: Discharge headlight service warnings
Discharge headlight bulb service warnings
To prevent electrical shock when replacing the discharge headlight bulb,
dry hands thoroughly, and carry out work in an area out of rain.
When the light switch is on, approx. 25,000 V of high voltage passes
through the discharge headlight bulb so ...