Here is the simplest way to reset the Bluetooth module on your mac if you are facing any issues using your Bluetooth mouse (Magic Mouse) or Bluetooth keyboard (Magic Keyboard).
This command will reset Bluetooth on your mac then it will connect back to all Bluetooth devices again after the reset.
Step 01: Open the Terminal app from your Mac’s Applications > Utility folder.
Step 02: Now copy-paste the below command in the terminal to reset Bluetooth on your mac
sudo pkill bluetoothd
Step 03: Success!
Hope it helps,
Thanks & Regards