WARNING: This page is about a different car, the 2020 Mazda CX-30. However, it is still accessible from the selected car via links, so may be relevant.
Insert a new battery (CR2032) into the remote transmitter so that the positive pole is facing up.
Install the cap.
Courtesy of MAZDA MOTORS CORP.
Install the upper cover.
Courtesy of MAZDA MOTORS CORP.
Insert the tabs of the lower cover into the slots of the remote transmitter and install the lower cover.