You may follow these steps below:
1. Make sure the Bluetooth on your phone is switched on.
2. Select "Communication" button on the infotainment screen.
3. Select "Pair New Device" button on the Bluetooth Settings page.
4. On your phone's Bluetooth connection page, click the Mazda option.
5. Copy the pairing code displayed on the infotainment screen.
You're paired!
Do note that not all phone models work for all Mazda's Bluetooth connections.