Charge the batteries in your accessories
Your Magic Keyboard and Magic Mouse each have a built-in rechargeable battery.
Check the battery level. Click the Control Center icon in the menu bar, click the Bluetooth icon , then choose the device.
Charge the battery. Connect your Magic Keyboard or Magic Mouse to your iMac with the included USB-C to Lightning Cable or Lightning to USB Cable.
Tip: To charge the battery faster, be sure your input device is turned on when you connect it to your iMac.