What is a magnet? A magnet is any material that possesses a magnetic field. This field exerts forces on any ferromagnetic material within its vicinity. Not all metals are attracted to magnets. Gold, aluminum, silver, and copper are considered non-ferromagnetic metals, i.e., they are not attracted to magnets.
Ferromagnetic materials are Iron, Nickel, Cobalt, and alloys containing them. When a magnet comes in contact with a ferromagnetic material, the atoms become lined up. This results in a magnetic force between the ferromagnetic material and the magnet.
Magnets have two poles. These poles decide whether the ferromagnetic material is going to repel or attract. The attraction of two magnets will happen if the poles are opposite. For example, if the magnets are positive to positive they will repel; if they are negative to positive they attract and stick together.