The figure shows a schematic of the Earth's magnetic field visualized through field lines. In the real world the magnetic axis between the magnetic North and South Poles does not coincide with the axis of rotation exactly, so the actual magnetic field is slightly turned with respect to the axis of rotation. The effect is very small and varies with time.
The same magnetic field can be produced if the Earth is replaced by a giant bar magnet as shown.