You can block individual sites, or only allow your Mac to access certain sites, via Screen Time.
When you block someone on Facebook, you prevent them from messaging you, tagging you, and seeing your posts and profile.
This guide explains how to block and filter websites to restrict employee access to certain content on the company network.