You could try another USB port if there is one available. If your mouse is wireless, it may be a weak or dead battery.
Open Device Manager (type “Device Manager” in the Windows search field.
Expand the Universal Serial Bus controllers branch
Double-click the first USB Root Hub device in the list (if you see only one USB Root Hub device, that’s fine)
Click the Power Management tab
Un-check the Allow the computer to turn off this device to save power checkbox, and click OK.
Repeat steps 3-5 for each USB Root Hub device in your list of Universal Serial Bus controllers
Another option is check your USB device drivers
Your USB ports not working problem is probably being caused by driver issues.
Lastly check your USB ports for damage.
If none of the above methods resolve your problem, your USB ports might be damaged. To find out, you can take your PC to a repair store and ask them to check. If your USB ports are damaged, the repairer should be able to replace them fairly inexpensively.