The only surefire way is to disable javascript, extensions, cookies, etc.
https://browserleaks.com has a pretty good breakdown of the different techniques you can use. There's another JS technique that probes the hardware to fingerprint a browser too.
http://yinzhicao.org/TrackingFree/crossbrowsertracking_NDSS1...
Use Tor Browser even if your not using Tor if you're looking for better privacy. It's modified to mitigate as much as possible. Facebook is just bad. Avoid it at all costs if you value privacy. And it's not just facebook. Sites like facebook, google, etc also use several 3rd party "advertising" (i.e. data gathering) companies to gather data and build profiles on users and share that data with each other. Even on your regular use browser I would highly recommend uBlock Origin and Privacy Badger.
https://github.com/gorhill/uBlock
https://www.eff.org/privacybadger