To determine the purity of a substance, test its melting point or boiling point.
If it melts or boils at a fixed temperature, it is a pure substance.
Another method is to carry out a chromatography of the substance.
If it separates out into only one spot on the chromatogram, it is a pure substance.