Outline Thomsons experiment to measure the charge/mass
Firstly JJ Thompson got a cathode ray tube, put two large metal plates on either side of the cathode ray tube and applied a voltage to them to form an electric field going through the cathode ray tube. Then he switched on the cathode ray tube and saw what happened as the beam of electrons went through the tube as an electric field was applied. What happened? The beam got deflected in the direction opposite to the electric field (i.e. towards the positive plate), not surprisingly since the beam is made of electrons and electrons tend to move in the direction opposite to the electric field.
Then he applied a magnetic field by putting the south pole of a magnet underneath the cathode ray tube, and the north pole of another magnet on top of the cahode ray tube. What happened now? There's now magnetic field lines going perpendicular to electic field lines inside the cathode ray tube. The end result is that there is now two forces acting on the electron beam passing through the cathode ray tube. The electric field and magnetic field was adjusted just so that they cancelled eachother out so that the electron beam wasn't deflected at all (net force on each electron = 0).
therefore: F (electric) = F (magnetic)
since F (electric) = qE, and F (magnetic) = qvB
qE = qvb
v = E/B
Now we can determine the velocity v of the electron beam in the cathode ray tube, from the electric field E (which we know since E = voltage/distance), and B (magnetic field strength). So now that we know the velocity of the electrons, lets get rid of the electric field on the cathode ray tube, we don't need it anymore. Now there's just the magnetic field acting on the electron beam. As you know, as an electron moves in a magnetic field, it undergoes circular motion, and the magnetic force provides the centripetal force required for the circular motion.
F (centripetal) = F (magnetic)
m(v^2)/r = qvB
q/m = v/rB
since we know v already from above, and we know B (the magnetic field strength), and you can find out the radius r that the beam curves just by looking at it, you can work out the q/m ratio, just like JJ Thompson did.