Use this trick to prevent it from boiling over.
Put the milk in the stainless steel heavy bottomed pan and turn the medium heat on.
Keep a wooden spoon over the pan. The wooden spoon acts as a security valve.
Even if the milk boils and foams up, it does not spill over.
This trick also works on boiling daal or lentils.