On recent versions of OS X, pf is installed and running by default. The linked question is referring to changing the pf configuration, not installing a new utility. Modifying a firewall on a production system is not something which should be done without reading the documentation (man pf.conf , man pfctl).
To add that block line (or experiment with other configuration changes), you would add it to the configuration file /etc/pf.conf with your preferred editor, and then reload the firewall configuration with
$ sudo pfctl -f /etc/pf.conf