Using the cathode ray tube.
JJ Thomson was interested in knowing about other subatomic particles other than the protons.
So,he designed the cathode ray tube.
The cathode ray tube:
A high voltage generator is connected to the anode and cathode.When the Generator is switched on,Rays are formed from the cathode.So,the rays are called cathode rays.
A vacuum pump is connected to the tube because when the air pressure is low we can easily create cathode rays.
JJ was interested in knowing about these rays.So, he put 2 oppositely charged plates next to each other in the tube.
To his surprise the cathode rays started diverting to the positively charged plate.Then he made a note that the rays are negatively charged because,positive is attracted to the negatively charged bodies vice versa.
JJ thought for a while and was interested whether these rays are made up of particles.So,he kept a pinwheel in that tube.
The pinwheel started rotating.So,JJ made a note that these are negatively charged
And this is how the electron was discovered. :)