Elec Man is very quick. When you shoot him once, he will jump away from you. Shooting him consecutively will make him jump towards you, so don't. Keep your distance away from him by moving on the left side of the room & use the high grounds to evade his Thunder Beams. Shoot him when he is far away from you. When he gets near, don't shoot & let him run far away from you again. Be on guard when he shoots, especially when he is near you. If you observe his attack pattern, he shoots whenever he gets in front of you, then runs back. Use this to your advantage! He is also one of the Robot Masters who is knocked back when hit.
Elec Man is weak against Rolling Cutter, which you will get if you defeat Cut Man beforehand. It takes 3 Rolling Cutters to defeat Elec Man. It is best to use it it 2 throws. Do a 2-chain attack with Rolling Cutter so you can do 2/3 damage, jump as he shoots you, don't move from your entry point on the room then deal the final blow.
In Dr. Wily Stage 2, you will encounter him again for a rematch. You can scare him away with Rolling Cutter & be sure to hit him. Or you can do the 2-chain attack maneuver for an easy win.