A mass analyzer operates by generating ions from the sample and then using electric and magnetic fields to separate these ions based on their m/z values. The separated ions are then detected and quantified. The process involves several key steps: ionization, acceleration, deflection, and detection. Different types of mass analyzers use various principles to achieve this separation.