Initally you may need to use a USB keyboard (most all work with the Mac's) to turn on the BlueTooth and setup your wireless Keyboard.
Have a look at > Troubleshooting wireless mouse and keyboard issues
When using Setup Assistant to configure your Mac mini or iMac for the first time, the Bluetooth keyboard may have difficulty pairing.
Use a wired keyboard to configure the Mac mini or iMac with the Setup Assistant. If a wired keyboard is not available, follow these steps:
- Press and hold the Power button until the computer turns off.
- Press the Power button to start the computer.
- When a language selection appears, press and hold the power key on the Bluetooth keyboard so that the green light is flashing (discoverable mode).
- Use the mouse to click the language you would like.
- A code should appear on the screen. Enter the code on the Bluetooth keyboard and press Return. Note: No visible feedback appears on the screen while you enter the code.
The computer and the wireless keyboard should now be paired.