Well try some simple resets first. Reset the NVRAM and restart in Safe Mode and check to see if either helps.
NVRAM Reset & Safe Mode Reset instructions
I'd also try the following steps too:
The following will require any USB keyboard and mouse. If you don’t have them, borrow or buy them, they are inexpensive!
- Connect the USB keyboard and mouse to the computer.
- Open System Preferences – Bluetooth
- Un-pair the wireless keyboard and mouse.
- Turn off Bluetooth
- Restart the computer in Safe Mode per the directions in https://support.apple.com/en-us/HT201262
- Restart the computer normally.
- Open System Preferences – Bluetooth
- Turn on Bluetooth
- Re-Pair the wireless keyboard and mouse.
- Unplug the USB keyboard and mouse and begin testing the wireless devices again.