Keep in mind, however, that there seems to be an intentional handicap if you’re on an older version of macOS: you can’t install the latest Swift.
I have an Intel-based MacBook Pro that doesn’t update beyond macOS 13, and it runs neither Xcode 16 nor Swift 6. Presumably, one might be able to build Swift 6 from source. My workaround is containers.