The first step (other than getting a Mac) is to download Xcode from the Mac App Store. Visit swift.org for instructions on how to install Swift on other platforms such as Linux and Windows.
If you've been using Xcode for a while, you should remove old simulators that are no longer supported to clear up some space. Use the following terminal command to delete the old simulators:
xcrun simctl delete unavailable
Swift Programming for macOS © 2023
Built by Gavin Wiggins