>>1826147OK, well you need to figure that out first.
If you're not aware, there are (besides weird, rare, old stuff) 3 disc brake mounting methods for frames and forks. Tab mount (also called I.S. mount), post mount, and flat mount (pretty much only found on road and gravel bikes). Most modern MTB frames and forks use post mounts and tab mounts are more common on steel frames and forks.
As for brake calipers themselves, you don't see tab mount versions very much at all anymore. So usually if you've got a flat bar brake, it'll be post mount and a drop bar brake may be flat or post mount. If you're mixing frame/fork and caliper mounting methods then you'll need an adapter. You'll also need an adapter if you're using rotors sized differently than the frame/fork calls for.