Before we look at electromagnets let's recap bar magnets.
Bar magnets are permanent magnets. This means that their magnetism is there all the time and cannot be turned on or off. They have two poles:
The north pole is normally shown as N and the south pole as S.
Magnets are made from magnetic materials. These are metals that can be magnetised or will be attracted to a magnet. Most materials are not magnetic, but iron, cobalt and nickel are magnetic. Steel is mostly iron, so steel is magnetic too.
If you bring two bar magnets together, there are two things that can happen:
if you bring a north pole and a south pole together, they attract and the magnets may stick together
if you bring two north poles together, or two south poles together, they repel and the magnets push each other away.
We say that unlike poles attract, and like poles repel.
How can you test if a piece of metal is a magnet. Seeing if it sticks to a magnet is not a good test, because unmagnetised iron, steel, cobalt and nickel objects will be attracted to either pole of a magnet.
So you can't test for what it is attracted to. But you can test what it repels:
Keyfact:
You can only show that an object is a magnet if it repels a known magnet.