The firewalls included with Macintosh and Microsoft Windows provide protection only for inbound traffic. If your computer has been infected, it can still be used by malware on your computer to launch malware attacks against other computers.
For complete protection, you’ll need to use a firewall other than what’s included with your operating system so that you can filter outbound traffic. Many antimalware software packages also include a software firewall. If it includes a firewall with outgoing traffic monitoring, all you need to do is enable it. If it doesn’t, you can install a standalone third-party firewall that includes this feature. There are several free and pay options.
Here are some of the best available for Windows computers.
For Macintosh computers, there are several options, such as WaterRoof and NoobProof.