What are the factors that I need to find out, and how do I go about finding this out, if I can swap the Hard Drive from one of my old laptop to another ?

I remembered some years ago when I changed the HDD of my old laptop, I had bought a Hard Drive that has a higher capacity than my laptop can handle, Thus I spent extra money on a Hard Drive capacity that could not be used on that laptop. Hoping to avoid this, this time.