How To Install PostgreSQL & pgAdmin On Mac M1/M2 | Easy Installation of PostgreSQL, pgAdmin On MacOS
How to Install pgAdmin On Mac Without Homebrew | Easy Installation of pgAdmin4 On MacOS
How To Uninstall PostgreSQL From Mac M1/M2 | Completely Remove PostgreSQL & pgAdmin From MacOS
If still the ports are not free then
sudo kill -kill $(sudo lsof -t -i :5432)