How to adjust the keyboard backlight on the new M2 M3 MacBook

The latest Macbooks lack keys to adjust keyboard brightness and F5 and F6 don’t work as it was previously. To fix that create a new plist file in ~/Library/LaunchAgents 

named com.local.KeyRemapping.plist and added the code below.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
              "HIDKeyboardModifierMappingSrc": 0xC000000CF,
              "HIDKeyboardModifierMappingDst": 0xFF00000009
              "HIDKeyboardModifierMappingSrc": 0x10000009B,
              "HIDKeyboardModifierMappingDst": 0xFF00000008

Save the file and reboot. F5 and F6 will now work as keyboard brightness up/down keys (after you log in for the first time after rebooting).

Also, you can add MacOS Settings -> Control Center -> Keyboard Brightness

Switch on the needed controls 

Now the keyboard brightness can be controlled from the Control Center (top right corner of the Screen)