Question: how to set up imac with wireless keyboard?
Answer: Turn on your device.
Wait until your device's LED starts blinking, which means that it's in Discoverable Mode. ( ... 
Choose Apple menu > System Preferences, then click Bluetooth.
Wait while your Mac searches for your device.