how to stop a port in macos

Shell
kill -9 port
Source

Also in Shell: