In 1263 Pierre de Maricourt mapped the magnetic field of a lodestone with a compass. He discovered that a magnet had two magnetic poles - North and South. Then, way back the 1600's a guy named Willam Gilbert figured that the earth itself is a giant magnet with north and south poles, too. But a permanent magnet will keep their magnetic properties for a very long time. Permanent magnets are made by placing pieces of iron cobalt, and nickle into strong magnetic fields.
Permanent magnets are mixtures of iron, nickle, or cobalt with other elements.
These are called hard magnetic materials. Electro magnets are temporary magnets made by electric currents. The simplest electromagnets are made of an electric current flowing through a coil of wire. Many electromagnets have a cylinder made of soft magnetic material. One end of the thing becomes the north pole of the electromagnet and the other end becomes the south pole.