That’s all, restart your system and check on next login windows allows adjusting screen brightness. Restart windows and check This will fix “can’t adjust brightness ” bug. You Can check And install latest updates from Settings ( Windows + I ) -> Update & Security -> windows update -> And check for updates.
If the problem started after install windows 10 version 21H1, then make sure you have installed the latest Cumulative Update, As Microsoft mention: “ Addresses an issue with the brightness controls on some laptops after updating to the Windows Update.