Even if your device lets you root it (many don't), you will trip the "Knox fuse." It's a small fuse inside the CPU that permanently burns out if you root, and permanently blocks Samsung Pay, Secure Folder, a few other Samsung security apps... and on the Galaxy Z Fold 3, your camera (though on the Z Fold 3, apparently, if you re-lock your bootloader the restriction goes away). Also said fuse cannot be reset so if you reinstall completely stock firmware, it's blown forever.