Make and model keyboard and mouse? Wired or wireless? Desktop or laptop computer?
Do other keyboards and mice work on your computer? Do the keyboard and mouse work on another computer? You need to narrow down the problem.
If wired, check the connections at the back of the desktop computer.
If wireless check the keyboard and mouse batteries. Also check the wireless transmitter/receiver to the computer. If applicable.
Download and reinstall the applicable keyboard and mouse drivers via the manufacturer's website. Be sure to download the correct drivers for your OS.