They're fully compatible. Just plug them in and it'll work fine
That's not always true. Some OEM's use a proprietary interface (Dell and Sony mostly, but I've seen them on HP and Lenovo as well). It should be immediately obvious, though, usually before unplugging the drive from from the laptop. Sometimes one gets fooled by a combined all-in-one connector, that upon disconnecting shows just a standard set of drive connectors.
If they are incompatabile, sometimes one can replace the circuit board, but finding out what model to get the CB from proves very difficult. (sigh)