Install the lastest Xcode from the App Store. Xcode is Apple’s development environment for all their operating system (iOS, macOS, watchOS, etc.) so if you want to develop software for Apple products you will need this programme. Xcode is free for Mac owners.
After you have installed Xcode, install the command line developer tools (CLDT). Open a Terminal and type the command:
$ sudo xcode-select --install
sudo will execute the following command as administrator. So you will be required to enter your password after hitting Enter.