The Mazda 6 uses an H1 halogen bulb replacement for headlights, regardless of whether it's a high beam or low beam. Each sits inside its own chamber at the back of the headlight assembly. The low beams are on the outer edge of the assembly, while the high beams are on the inner edge. Check the location of the faulty bulb before attempting to replace it--unless you plan to replace them all.
Ensure that the Mazda 6 ignition key is not in the ignition and the power switch for the headlights is in the "Off" position. Some manuals will tell you to disconnect the battery--but unless you're being careless, this is not necessary in order to replace a headlight.
Release the hood latch. Open the hood, and locate the back of the headlight assembly. You will see two separate black plastic dome covers with the words "Top," "Open" and "Close" stamped on them. Turn the cover in the direction of the word "Open" until the cover separates from the headlight assembly. Set the cover aside.
Use a small mirror to assist your vision, by positioning it down near the opening of the headlight assembly. You will be able to see the wire plugged into the blades of the headlight as well as the wire retaining clip that holds the headlight inside the assembly.
Pull the wire harness off the blades of the headlight.
Note the screw on one side of the wire retaining clip. This also acts as a hinge for the clip, so on the opposite side of the screw locate the release tab of the clip. Push inward on the tab and then slightly away from the locking notch. The clip will open and allow you to pull the headlight out of the assembly.
Note the position of the flat edge of the headlight base. The base is round except for one spot. This it the top of the headlight; you must install the replacement headlight in the same position.
Put on the latex gloves before handling the replacement headlight. Oils on your hand can create weak spots on this high-intensity headlight bulb and cause it to burn out prematurely.
Insert the headlight into the assembly with the flat part of the base in the upward position. Swing the wire spring clip into position and push inward on it again, then toward the locking notch, until it latches properly. This is more difficult to reattach than to disengage, and the mirror will help you out tremendously here.
Plug the wire harness onto the blades of the replacement headlight, and test it by turning on the headlights. Check the gasket of the black cover to make sure it's seated properly. Replace the cover by inserting it and turning it toward the word "Close" until the word "Top" appears on top.