A freely suspended magnetic needle points in the geographic north-south direction because it aligns itself with the Earth's magnetic field. The Earth acts like a giant magnet, with its magnetic north pole located near the geographic north pole, and its magnetic south pole located near the geographic south pole. This creates a magnetic field that extends around the Earth.
A magnetic needle has two ends: a north-seeking pole (usually painted red) and a south-seeking pole (usually painted blue). When you suspend a magnetic needle freely, it will align itself so that its north-seeking pole points toward the Earth's magnetic north pole, which is close to the geographic north pole. This alignment is due to the interaction between the Earth's magnetic field and the magnetic properties of the needle.
A device based on this phenomenon is called a magnetic compass. A magnetic compass consists of a magnetic needle (usually mounted in a housing) that is free to rotate and align itself with the Earth's magnetic field. By observing the direction in which the needle points, you can determine your orientation relative to the Earth's magnetic north and south poles. This makes a magnetic compass a valuable tool for navigation and finding directions, both on land and at sea.