The function keys F1 & F2 will adjust the keyboard brightness down and up.
Turn your Mac keyboard’s backlighting on or off - Apple Support
Have you restarted your Mac lately?
Rebooting is the best first step in troubleshooting.
If a simple reboot of your Mac doesn’t fix things, see if the problem still happens in safe mode. Safe mode will often correct weird software behavior by forcing the OS to clear caches, do disk repair and other self-maintenance and housekeeping and temporarily disables third-party mods.
How to use safe mode on your Mac - Apple Support
Does the same thing happen while in Safe mode?
You can exit safe mode by restarting your Mac normally, then reevaluate the problem.