Out of the some 117 elements known in the world, three are special. Cobalt, nickel and iron have a special arrangement of electrons that causes them to have a magnetic field. All permanent magnets are composed of one or a combination of these metals. Magnetic fields are measured in either Tesla or Gauss.
Technology would be very limited if the only way to get a magnetic field was from one of the three special metals. Fortunately we can arrange a current flow of electrons in a special way so that we can mimic the magnetic field found naturally in these three elements. All currents create magnetic fields but when the arrangement of the current is specifically for the purpose of making a magnetic field we call it an electromagnet. Electromagnets can create exactly the same magnetic fields found in permanent magnets but have the added advantage that they can be turned off or reversed by turning off or reversing the current flow through them.