Unreal Launch error: Can’t find Xcode mental compiler in MacOS

Enter the code below in terminal, and then enter your password to grant permission:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer