Earth has two geographic poles, the North Pole and the South Pole. They are the places on Earth's surface that Earth's imaginary spin axis passes through. Our planet also has two magnetic poles, the North Magnetic Pole and the South Magnetic Pole just like a bar magnet. The magnetic poles are near, but not quite in the same places as, the geographic poles. The needle in a compass points towards a magnetic pole. Earth's North Magnetic Pole is actually the south pole of the Earth's geographic poles and vice-versa.
Hence, a freely suspended magnetic needle point in geographic north-south direction. The magnetic compass is the device that uses this principle. A magnetic compass contains a magnetic needle pivoted in a horizontal plane, that indicates the direction of magnetic north at points on the earth's surface. It is an instrument that uses a magnetized steel bar to indicate direction relative to the earth's magnetic poles.