A compass is a navigational instrument that shows directions in a frame of reference that is stationary relative to the surface of the Earth. It works by aligning a magnetic needle with the Earth's magnetic field, allowing users to determine cardinal directions such as north, south, east, and west.