You have to pay attention, that your hard drive uses the same connection type and form factor or height.
With the very common 2.5? hard drives you have to check whether your notebook still uses the old PATA standard or SATA and also you have to check what height is compatible since there are multiple heights. 7mm, 9mm and 15mm are the most common ones.
For SSDs there are also small form actors like mSATA or M.2. With the latter one you have to check if the slot supports the SATA and/or PCIe (NVMe) protocol.
The only thing that is not limited is the capacity and speed of your new drive.