Open regedit.exe,
go to Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize and set both AppsUseLightTheme & SystemUsesLightTheme DWORDs to 0.
Alternatively, download and save the windows-dark-mode.reg file below as a .reg file and run it.
Source: https://old.reddit.com/r/Windows11/comments/o1l55u/how_do_i_enable_dark_mode_on_windows_11/h21f69b/
changing these registry entries used to be enough on windows 10. but on windows 11 explorer (and startbar with it) do not get the change.
you can force it by restarting explorer, but there should be a less brutal solution, since switching through the windows settings does not require restarting explorer.