Build Unreal Engine from Source
Following section serves as guidance on how to build Unreal Engine from source.
Install Visual Studio Community 2019 & 2022
As the very first thing I recommend installing Visual Studio Community 2019 & Visual Studio Preview 2022.
Visual Studio Community 2022 serves the sole purpose of building Unreal Engine, as it is noticeably faster in that than Visual Studio 2019.
Visual Studio Community 2019 will be your actual IDE to code in, as Visual Studio 2022 isn't Unreal Engine ready yet.
Both feature the same installer, this setup is enough for now.
Visual Studio might recognize missing components automatically at a later point, in that case it will install them for you trouble-free and very easy.
Download Unreal Engine Source
Decide whether you want to download Unreal Engine 4 or 5.
Unzip them to one of your hard drives and give them more readable names.
Name has to be between 6-24 characters.
Build Unreal Engine
Inside your folder click the folder-path and replace it with cmd, press Enter.
Type Setup.bat
Type GenerateProjectFiles.bat -2019
or GenerateProjectFiles.bat -2022
Open the generated .sln file with Visual Studio, preferably Visual Studio Preview 2022
Press Clean
Press Build
Set as Startup project
Press Debug
A warning of this look could appear the first time you open Visual Studio, go ahead and install the missing components