A ratchet wrench is a type of socket wrench that uses a geared mechanism to turn fasteners with less effort than a traditional socket wrench, and in a fewer steps. The ratchet head generally has gears that tighten or loosen fasteners as the handle of the ratchet is turned in either direction, and may have a switch on it to change directions from clockwise to counterclockwise. The ratchet can also have a socket on the end of it that is attached to a length of extension, sometimes called a crow's foot adapter, which can be used in hard-to-reach spaces where a regular socket and wrench would not fit.
Most ratchets come with a socket set, and each socket has a drive size that corresponds to the size of the socket's drive square (which is a square-shaped part on the outside of the socket). The socket fits into this socket size by fitting the drive socket side hole or internal notch into the drive square on the ratchet. The socket is then held in the drive socket by a ball detent or a spring-loaded ball stopper that locks into place when the ratchet is turned to lock the drive.
Different fasteners require different socket sizes and types, so a ratchet set usually comes with many sizes of sockets to cover all the common nut and bolt sizes. These are commonly available in fractional inch and metric sizes, and in short (shallow) or long (deep) varieties.
To use the ratchet, you simply line up the socket head on the fastener that is being worked on, and then attach the socket to the ratchet. Make sure that the drive socket square is lined up with the drive square on the ratchet (which may require some turning of the ratchet head to align). Next, press down on the socket, and you should hear or feel the ball bearing of the drive square snap into place on the socket. At this point, you can continue to loosen or tighten the fastener by moving the ratchet handle in the desired direction.
You can also get a ratchet with a lever or dial switch on the back of the ratchet head that will change from counterclockwise to clockwise. This feature can be especially useful in hard-to-reach spaces where you would have to move the whole ratchet head to move it to turn the fastener.
There are a wide variety of extensions, or crow's feet, that can be attached to a ratchet to extend its reach in hard-to-reach spaces. These can be especially helpful when working with a scaffolding ratchet, as it allows you to tighten or loosen hardware in areas where there is not enough room to maneuver a conventional wrench. Some ratchets have a torque limiter on them, which will click when a specified amount of torque is reached and stop turning the ratchet. This can be used for applications such as assembling machinery or structures that need to be secured at a specific torque value, or for safety purposes to prevent the accidental over-tightening of fasteners.