The instructions apply for all devices that have firewall features. On PCs there is a Windows Firewall, but you also need to check your modem/router for these port configurations as well regardless of the device connecting to that router and modem.
I’m using a Mac & am unable to find a way to configure the ports mentioned in the link provided. I also followed the directions for macOS & it was already configured in the way specified in the directions.
Please refer to the instructions that come with your Router/Modem to access that device’s port configuration. Chances are this involves opening your web browser entering a local IP like 192.168.0.1 or http://home. You will not be configuring the ports of your Mac itself. If you are not familiar with exactly how to do this, I recommend not continuing and instead check out the follow up thread I posted.