For wired connections just connecting it by USB should install the necessary drivers and it should work ok.
For Bluetooth connections, disconnect the USB cable then turn the keyboard upside down.
Install two batteries in the correct orientation.
Switch the Bluetooth switch to On, then press the Bluetooth button.
The Bluetooth indicator should begin blinking blue.
Next click the Apple menu, and click System Preferences.
Click Bluetooth, then click the '+' button on the bottom left.
This launches the Bluetooth Setup Assistant.
Follow the instructions in the Bluetooth Setup Assistant to pair the keyboard.
The quick start guide is also available by clicking on this link:
Please take a moment to rate my answer.
If you have any questions please don't hesitate to reply.