How Magnets Are Made
There are four main ways to magnetize a magnetic substance: (1) bringing the substance near a magnet; (2) using electric current; (3) stroking the substance with a magnet; and (4) striking a blow to the substance while it is in a magnetic field. The first two methods were discussed under the subtitle Permanent and Temporary Magnets: Temporary Magnets.
A permanent magnet can be made by stroking a magnetic substance with either the N or the S pole of a magnet. Stroking lines up the domains in the material.
A piece of iron can be magnetized by holding it parallel to a compass needle (along the lines of force in the earth's field) and hitting the piece of iron with a hammer. The blow will overcome the resistance of the domains to movement, and they will line up parallel to the earth's field.
To demagnetize an object, a strong magnetic field is used. In one method, the magnetic field is made to fluctuate very rapidly. In another method, the magnetized object is placed so that a line drawn between its poles would be at right angles to the field. The object is then tapped or hit until its domains are no longer lined up magnetically.