My keyboard on my laptop stopped working properly?

I currently have a Lenovo laptop, I went to sleep last night a shut off my laptop like every other day, but when I woke up this morning I tried to log in but my space, n, and b keys were not working. I tried to clean them but that didn't help. I was only able to get on thanks to the on-screen keyboard. I'm afraid I will soon be able to use less keys. How can I fix my keyboard?

I'm not sure how to fix it, but i had the same problem a long time ago. If you don't want to get a new laptop, jut buy a small keyboard.
Sorry if this isn't helpful

Plug in a usb keyboard insteadMy keyboard on my laptop stopped working properly

Well it depends on how old your Lenovo laptop is. Heat is a real problem for laptops and sometimes with extended exposure to heat and consistent use over the years, the heat from the CPU (since its right under the keyboard under the PCB) will cause damage to the keyboard itself. It's sensitive membrane will get damaged from heat and the contacts will not work as intended.

I've had a few laptops that ended up like that because I really push them hard as a computer scientist, I'm always crunching numbers.

The best thing to do is remove the keyboard from the laptop, on the underside of the keyboard there's an SKU number / model number. Just type that into a google search and purchase a replacement, they're usually dirt-cheap.