All magnets have both a north and a south pole, which causes them to either repel or attract one another depending on how the two poles are lined up. If the north pole of one magnet meets the south pole of another, the two will be attracted, but if either both north or south poles meet, the magnets will repel one another.
No matter what type of magnet, the opposite poles always attract while similar poles always repel. Each magnet sends out a magnetic field, which is positive on one pole and negative on the other. This magnetic field is the result of the movement of negatively charged electrons within the magnet. These fields are strongest directly at the pole, which is why the ends of magnets will so powerfully repel or attract each other.
Magnets are constructed from one of the magnetic metals, such as iron, nickel or cobalt. These materials will always be attracted to a magnet, or they can be magnetized to form a magnet themselves. Steel is another magnetic material, as it is usually constructed mostly of magnetic iron.
To test whether a material is magnetic, it is necessary to use another magnet to see whether or not the two will repel one another.