One way to quickly sort text on macOS that I’m currently using is this:
I copy the text (Mark text & CMD-C) and them do this in iTerm:
pbpaste | sort | pbcopy
And that’s it, already. The text is sorted and copied back to the clip board.
Update: this small change fits my actual needs even better: Sort the input case-insensitive:
pbpaste | sort -f | pbcopy
And as an Alfred App user I can even do this (and don’t have to open a terminal):