A quadrupole mass analyzer consists of four parallel rods arranged in a square. These rods create an oscillating electric field that influences the path of ions traveling through the device. By adjusting the amplitude and frequency of the electric field, only ions with a specific m/z ratio can pass through the analyzer and reach the detector.