Hello Jadoon01,
Thanks for reaching out to the Apple Support Communities. We understand you are looking for some help with pairing your Bluetooth keyboard to your Mac. We are happy to help provide some guidance.
If you are using an Apple Magic Mouse or Magic Keyboard, try following the steps outlined in the following resource to make sure that they are turned on and ready to pair with the Mac:
If you can't connect your Magic Keyboard, Magic Mouse, or Magic Trackpad to your Mac
If you are using a third party mouse and keyboard, reference their user manual to ensure the devices are powered on and ready to pair:
Connect a Bluetooth device with your Mac
If you continue to experience issues, try connecting a wired keyboard and mouse to the Mac and boot it into safe mode. Once in safe mode, restart and try pairing the Bluetooth devices again:
How to use safe mode on your Mac
We hope this information helps.
Best Regards.