How to restart a Mac book with no keyboard
iPhone XR
iPhone XR
Good afternoon neema210,
Welcome to the Apple Support Communities!
It appears you are trying to set up an iMac (desktop computer) with a wireless bluetooth keyboard. The best way to troubleshoot this is to connect a wired, USB keyboard to your iMac and restart it. If you do not have the original keyboard that came with the iMac, any USB keyboard should work. I keep one near my desk for situations like this. Once the computer is restarted and you have the USB keyboard working, then you can attempt to pair a Bluetooth keyboard to your iMac.
Using a Bluetooth mouse, keyboard, or trackpad with your Mac
Take care.
How to restart a Mac book with no keyboard