CyanogenMod was discontinued, but I’ll keep this up since you can probably try to flash something else using this. Also Heimdall is still very useful but not much talked about. You should probably use TWRP Recovery instead of ClockworkMod these days.
First install Heimdall using Homebrew Cask. You can also download the .pkg and install it manually. Heimdall includes a kext, so you need to reboot after installation.