Biot-Savart's law : Magnetic field at an axial point P due to a current element of the ring
We resolve dB into vertical and horizontal components. Now all the vertical components cancel out each other and so only the horizontal components survive which results in the net magnetic field at P in the horizontal direction.
Net magnetic field B=∫dBsinθ