First try rebooting (power off and back on) the laptop and see if that resolves it. If not, then you may want to look at cleaning out the keyboard of any dust, debris, etc.
If that doesn't help, then try uninstalling the keyboard driver, then reboot (power off and back on) without reinstalling it first. This will allow the computer to reinstall it on its own.
Now if the problem is still happening, then to see if it is software or hardware you can try connecting an external keyboard and see if the key on it works fine. If it does, then it is hardware and not software. A key can be easily damaged if it is one that is used a lot.