Have u checked the device manager as suggested by martijn?
it is a good idea to provide with more information. Like what happened before the problem. For example pc was working fine yesterday, this morning when i turned it on the problem shows up.
Try to use an external keyboard '''but first'''
If you are on windows 10 and can still get to the desktop do the following if the mouse still works. At the bottom on the left side on the taskbar left click on the window. A windows will open and on the left side close to the bottom choose the second bottom up (like a wheel)(just a highlight will show setting). On the windows that opens all the way down choose Update & Security. On the next window on the left side choose, Recovery and on the right side choose restart now. After the pc comes back choose Trouble shoot and next screen, choose advance options and then choose start-up settings and click “restart”, when windows come back choose number 4 (safe mode). If the keyboard works after that then i will say ur pc is infected or the driver for the keyboard needs to be re-installed.
On windows 7 after the pc is turned on and after the logo start tapping on '''the F8 key''' and choose safe mode the rest same as above
If u still have same problem now use the external keyboard in safe or full mode. If the keyboard works fine the internal keyboard is bad.
P.S. I could give you more tips (or other ways to check your keyboard) but that requires more technical knowledge.