All doors lock automatically when the lock side is pressed. They unlock when the unlock side is pressed.
Driver's door

Front passenger's door

To lock all the doors from an open front door, press the lock side of the door lock switch and then close the door.
NOTE
When locking the doors this way, be careful not to leave the key inside the vehicle.
Locking, Unlocking with Transmitter
Auto Lock/Unlock FunctionMazda 6 Owners Manual: Cruise actuator removal/installation
1. Disconnect the negative battery cable.
2. Remove in the order indicated in the table.
3. Install in the reverse order of removal.
Cover Removal Note
Unclamp the clips of the heater hoses at the front of the cover.
...
Mazda 6 Owners Manual: Coil removal/installation
Note
Do not remove the coil unless you are replacing it.
When only the coil is replaced, the immobilizer system reprogram
procedure is not necessary.
1. Disconnect the negative battery cable.
2. Remove the column cover.
3. Remove in the order indicated in the table.
4. Install in ...