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.