Yeah it’s not a very easy process. You need to download a version of XCode which comes with the version of the SDK that you want to use from https://developer.apple.com/download/more/ and then copy it across from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.x.sdk into your current Xcode’s contents.
You may also need to edit the .plist file located in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist and change the MinimumSDKVersion if you want to use earlier SDKs. Otherwise Xcode will just say that it can’t find the SDK, even if you have it in the correct folder.
