To fix the issue of screen freeze while still being able to move the mouse, you can try logging out by pressing CTRL+ALT+DEL on your keyboard. Once the blue screen appears, click on Sign out and ...
The computer may freeze when the user connects a USB drive, external hard drive, or some other device (phone, keyboard, or mouse). So, in that case, you need to check the connected devices.