By looking up the computer's specifications.
If you are referring to memory, the main things would be how many memory slots the laptop has, if any, and the maximum compatible size of memory any slots will accept. Also depends on if you plan on replacing all the memory or just adding, if a slot is empty.