Magnets are either temporary or permanent. Temporary magnets are made easily by subjecting a ferromagnetic material to the magnetic field of an existing existing magnet that causes its domain to align temporarily producing magnetic field that lasts for a short time after the removal of magnet.

Permanent magnets are made by heating ferromagnetic substance beyond Curie temperature causing magnetic field of the domains to point in the same direction.

1 5 1
In every material there are several small magnetic fields called domains. Most of the times these domains are independent of each other and face different directions. However, a strong magnetic field can arrange the domains of any ferromagnetic metal so that they align to make a larger and stronger magnetic field. This is how most magnets are made.