Technically you cannot ‘block’ magnetic fields however you can redirect the magnetic field lines which is commonly known as ‘shielding’.  You need to offer the magnetic field lines a preferred path by introducing a material of high permeability around the area you wish to shield.  The field lines find the easiest way to travel and therefore will keep within the material of high permeability.  This can be seen in action on Pot Magnets or placing keeper plates on the poles of magnets.