Best Practice for Ninja build Visual Studio?

You should also have a maybe more convenient direct command prompt shortcut (search for a native tools shortcut in the start menu) that calls vcvars for you, in my case it calls:

C:\Windows\System32\cmd.exe /k "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat"