You’re probably familiar with the basics of magnets already: They have a north pole and a south pole. Two of the same pole will repel each other, while opposites attract. Only certain materials, especially those that contain iron, can be magnets. And there’s a magnetic field around Earth, which is why you can use a compass to figure out which way is north.
“Magnetism is a class of physical phenomena that are mediated by magnetic fields. Electric currents and the magnetic moments of elementary particles give rise to a magnetic field, which acts on other currents and magnetic moments.
The most familiar effects occur in ferromagnetic materials, which are strongly attracted by magnetic fields and can be magnetized to become permanent magnets, producing magnetic fields themselves. Only a few substances are ferromagnetic; the most common ones are iron, nickel and cobalt and their alloys. The prefix Ferro- refers to iron, because permanent magnetism was first observed in lodestone, a form of a natural iron ore called magnetite, Fe3O4.
Although ferromagnetism is responsible for most of the effects of magnetism encountered in everyday life, all other materials are influenced to some extent by a magnetic field, by several other types of magnetism. Paramagnetic substances such as aluminum and oxygen are weakly attracted to an applied magnetic field; diamagnetic substances such as copper and carbon are weakly repelled; while antiferromagnetic materials such as chromium and spin glasses have a more complex relationship with a magnetic field. The force of a magnet on paramagnetic, diamagnetic, antiferromagnetic materials is usually too weak to be felt and can be detected only by laboratory instruments, so in everyday life, these substances are often described as non-magnetic.
The magnetic state (or magnetic phase) of a material depends on temperature and other variables such as pressure and the applied magnetic field. A material may exhibit more than one form of magnetism as these variables change.” https://en.wikipedia.org/wiki/Magnetism