The magnetic field is the region around a magnet where a force acts on another magnet or on a magnetic material. The magnetic materials are iron, steel, cobalt and nickel. The force between a magnet and a magnetic material is always attraction.
The strength of the field depends on the distance from the magnet. It is strongest at the poles and gets weaker further away. The direction of the field at a point is the direction of the force on a north pole placed at that point. Field lines therefore run from the north pole of a magnet to its south pole.
To plot the field of a bar magnet, place the magnet on paper and put a small plotting compass near one pole. Mark the position of the needle's two ends with dots, then move the compass so that its back end sits on the front dot. Repeat, then join the dots to make a field line.
A magnetic compass contains a small bar magnet, and the needle points along the Earth's magnetic field. A magnet only lines up with a magnetic field, so the Earth must have its own field. This is evidence that the core of the Earth must be magnetic.