I lost connectivity with my apple mouse and key board almost a year ago and have not been able to figure it out it sees the key board and mouse then says it can not connect my I Mac. Have use the mouse and keyboard with other devices and they work.
Bluetooth connectivity to my mouse and keyboard
iMac 27″, macOS 12.6