Permit communication of specific port numbers (inbound rules)
Other Windows 11 settings and usage are summarized, so please refer to it.
Permitting communication of a specific port number (outbound rules)
Close (disallow) ports that allow communication
This is the procedure to close (disallow) the ports that have been allowed to communicate with the created [Inbound Rules] and [Outbound Rules].
security related articles
Run Windows 11 virus scan Disable/enable Windows 11 firewall Windows 11 allow communication on specific port numbers Windows 11 settings and usage summary