A pure substance melts at one fixed temperature, called its melting point. The change is sharp: the solid turns to liquid over a very narrow temperature range. Pure ice, for example, melts at 0 °C.
An impure substance melts over a range of temperatures, and it starts to melt at a lower temperature than the pure substance. So comparing a measured melting point with the data book value shows whether a sample is pure.
To measure a melting point, a small amount of powdered solid is packed into a capillary tube and heated slowly with a thermometer in a heating block or oil bath. Heating slowly near the melting point gives an accurate reading. Record the temperature at which the first liquid appears and the temperature at which all of the solid has melted.
Suppose the data book gives 122 °C for a compound. Sample A melts sharply at 122 °C, so it is pure. Sample B melts from 112 °C to 118 °C, a range of 6 °C, and below 122 °C, so it contains impurities.