Use the App Store app on your Mac to download Xcode. It’s free. After you download Xcode, it automatically appears in Launchpad, where you can click the icon for Xcode to launch it.
This guide introduces you to the major features and capabilities of Xcode. For a hands-on introduction to using Xcode, read Start Developing iOS Apps (Swift) in which you create a simple app, and you learn the basics of programming with Swift.