A magnetic compass works by aligning a magnetized needle or card to the Earth’s magnetic field. Mounted in a fluid-filled bowl, it remains stable due to gimbals. The compass shows direction relative to magnetic north, helping navigators steer accurately even during rough sea conditions.