Have you recharged the batteries in your keyboard? Do you have rechargeable batteries? Or do you have the new bluetooth keyboard from Apple that charges with a lightning cable?
To turn Bluetooth on go to System Preferences > Bluetooth and turn it on.
Then hold down the button on the right side of your keyboard if it's Apple to make it search for Bluetooth.
I'm assuming it's an Apple Bluetooth keyboard?