Either you have a software or configuration issue, or you have a hardware failure with the laptop.
You can try booting into Safe Mode to see if that prevents the keyboard issues. If this works, then you most likely have some third party software installed which is interfering with the normal operation of macOS.
You can try creating a new macOS user account. Log out of the main user account & log into the new user account. Do you have any keyboard issues while using the new user account? If not, then you likely have a configuration issue of some sort with your main user account (or an issue with a login item).
How soon after rebooting the laptop does the keyboard failure occur?
How much Free storage space do you have on your boot drive? Check the Free space value within Disk Utility (ignore the "Available" value as it is misleading).