Magnetic field diagnostic techniques base on the Zeeman and Hanle effects