First detect which elements are present (qualitative), then estimate how much of each (quantitative) to reach the empirical formula.
The compound is fused with a small piece of sodium metal, converting covalent N, S and X into ionic NaCN, Na₂S, NaX (and NaSCN if N & S are both present). The fused mass is extracted with water to give the “sodium fusion extract”, on which the element tests below are run.