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: Disconnection of the negative battery cable
Before beginning any work, turn the ignition switch to LOCK position,
then disconnect the negative battery cable and wait for more than 1 minute
to allow the backup power supply of the SAS unit to deplete its stored
power. Disconnecting the battery cable will delete the memories of the
...
Mazda 6 Owners Manual: To Turn Off an Armed System
An armed system can be turned off using any one of the following methods:
Pressing the unlock button on the transmitter.
Starting the engine with the push button start.
(With the advanced keyless function)
Pressing a request switch on the doors.
The hazard warning lights will flash twic ...