@Glyn Oh yeah, that's what I would have suggested first – watch David's video on that. That will guide you pretty well through this process.
And what's important too (maybe David even says that in the video): Make sure you get the appropriate XCode Version for your machine/system. I'm running Mojave 10.14.6 with XCode 10.3. But it might be a different version for yours. You can read details for each version on the version history archive: https://xcodereleases.com/
G