IMac keyboard not connecting
I have an Apple iMac 24 from 2021 with latest OS upgrades. When turned on, the wireless keyboard does not allow me to type in my password, so I am completely locked out - though the mouse connects fine. The keyboard is fully charged but there is no other way of connecting it. I’ve tried restarting a number of times without effect. Is there a way of fixing this on one of the latest machines?
iMac 21.5″, macOS 10.13