I was new to MacOS when I encountered this issue too.
To install Xcode we have two ways: Web and App Store on your Mac. If you download it using App Store the application will be present in the Applications Folder. For Web, a .xip is downloaded at your Download location by default Downloads Folder, which you need to click for the extraction to take place. Once the extraction happens, a Xcode Application will appear in the same location. Double click on the Application for it to install and then place the Application in the Applications Folder for it to appear in the Applications.
Now you will need to set the path for Command Line to be able to use Xcode commands.
sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer if you are using the Beta Version
or else
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
Note: Check your Xcode Application and use that in the path:
/Applications/Xcode Application Name.app/Contents/Developer
xcode-select --installdoes not install Xcode. Andsudo xcode-select -s /Applications/Xcode.app/Contents/Developerdoesn't install it either. So I wouldn't expect that to work, eh. To install Xcode, download it, yourself, and put it in the Applications folder, yourself.