May be due to:
Dust or debris under keys
Liquid spill damage
Keyboard membrane failure
Using compressed air may help.
Press Windows + Ctrl + O
Try clicking P and Right Arrow on the on-screen keyboard.
If:
On-screen keyboard works → Physical keyboard problem
On-screen keyboard also fails → Driver / system issue
To confirm further you may use External USB keyboard
Surface Laptop 3 keyboard is integrated to repair contact Surface support or a service provider for repair options.