Xcode is an essential development tool for any type of application development on macOS.
To install Xcode, search for the App Store using Spotlight search on macOS, then search for Xcode and click to download and install it. The process might take a long time due to the large size of the software.
Upon opening Xcode for the first time, it may prompt the user to install additional components. Confirm the installation of these components.
Although Xcode might not be needed to open regularly if not using Apple's methodologies to develop iOS or macOS applications, its tools are still required, hence the necessity to install it on the computer.