Hello, welcome to the Microsoft Q&A forum.
First, please enter the following command in CMD to see which devices can wake your computer:
powercfg -devicequery wake_armed
If your keyboard and mouse devices are not displayed here, please try:
- Open Device Manager → Expand "Mice and other pointing devices" and then "Keyboard".
- Locate your keyboard and mouse devices, then right-click the device → Properties → Power Management tab → Check "Allow this device to wake the computer" and then click OK.
These are my thoughts and suggestions; I hope they are helpful.