Note that you'll need to do this separately for each browser you use; for the biggest impact, you should opt out of all the other platforms as well.
Locking down tracking in your browser is also recommended: Look out for the option to block third-party cookies in your browser settings (the sort that can track activity across multiple sites), and consider using well-respected tracker blocking browser extensions such as Ghostery or Privacy Badger.
Much of what we've already said applies to Facebook's mobile apps as well. If you want to limit what Facebook knows about you, you're best off not installing the mobile apps at all. Doing so gives Facebook permission to log the Wi-Fi networks you connect to, the type of phone you have, the other apps you have installed, and more besides, as well as everything you do on Facebook itself.
You can't stop all of this data collection, but you reduce it. Head to the Facebook permissions page—under Apps and notifications and Facebook in Android settings and under Facebook in iOS settings—to block Facebook's access to your phone's location, your contacts, your phone's microphone and camera, and more.
However, even with location tracking turned off, Facebook still makes note of the approximate location that you access the web from via your IP address. It's only a rough guide—and Facebook says it's necessary to keep accounts secure and users verified—but you can't stop this from happening if you use Facebook.
More bad news: Other apps send data to Facebook as well, often automatically. Almost everyone has a Facebook account, and third-party apps want to make use of that data, whether it's to target users with advertising or to simplify the login process and get more user data as a result. Facebook isn't working in isolation here, and has many profitable partnerships with other apps and data brokers.
It's worth highlighting that Facebook, like Google, promises to use this treasure trove of data to improve its services and make life safer and more convenient for its users, as well as generating more profitable ads across its network.