A bar magnet is a type of magnet that has a long rectangular shape, like a bar. It produces a magnetic field and can attract certain objects made of iron or steel.