A magnetic compass, which is the most familiar type of compass and oldest navigational instrument used for determining direction, uses the earth's magnetic field to align its needle to face north. The needle is magnetized and points to magnetic north, which is actually different than true (geographic) north.
The compass baseplate is the flat surface that can be used as a ruler on a map, as it is marked along the sides with ruler increments. The compass housing is that raised portion of the compass which contains the needle and is filled with liquid. The needle is a magnetized piece of metal with one end painted red to indicate north. There will also be a "direction-of-travel" arrow printed on the center of the base plate which you can use for plotting your course. The "direction-of-travel" arrow will eventually point where you want to go. The dial is circular, and marked with each degree of a circle and the orienting arrow. The magnetic needle is inside the movable compass housing and it is always pointing magnetically north.
Earth's Magnetic Field
The earth's magnetic field is created by electrical charges and movement of the liquid metal core. The field radiates outward from the poles, surrounding the earth. The axis of the magnetic field is tilted in relation to the axis of rotation, which is why magnetic and true north are different. The earth's magnetic field causes magnetized needles to swing into a north-south position when the iron needles are hung from a thread.
A compass needle points parallel to the lines of force of the magnetic field. The angle between magnetic and true north for a given area is called the magnetic declination.
How To Use
Hold the baseplate at your chest with the "direction-of-travel" arrow pointing away from you (pictured above). Turn the dial to the direction you want to go, and then turn your body (leaving the compass against your chest) until the needle is in the orienting arrow. Add the declination angle to account for true north. You will be pointed in the direction you want to travel.
You need some practice and a map or computer program of your area to find the magnetic declination. Some more expensive compasses have a declination adjustment. It is always a wise idea to carry a GPS device as well as a map with you when hiking.