You may follow these steps below:
1. Turn on Bluetooth on your smartphone
2. Tap "MENU" button on the radio
3. Turn the knob until you see the word "SET UP"
4. On your phone's Bluetooth connection page, click the Mazda option
5. Copy the pairing code displayed on the radio
Do note that not all phone models work for all the Mazda's Bluetooth connections.