Hi. There is a very long story associated with this. It starts with the very first ideas about moving from the elements Air, Earth, Fire and Water model to the Chemical Elements. Lavoisier isolated a number of the Elements and tried to put them in an order. Read about him here and elsewhere.
Measuring the masses of nuclei was initially done by weighing chemical compounds but now we use a Mass Spectrometer (look it up) for Ions.