Ratchets are used in conjunction with sockets to tighten or loosen nuts and bolts. Ratchets come in four common sizes, 1/4-, 3/8-, 1/2- and 3/4-inch drive. The size refers to the width of the rotating metal square peg at the end of the ratchet that fits into a corresponding square hole in one end of the socket. The square peg on the ratchet has a small, metal ball on one of the side faces of the peg, which fits into a detent in the socket. Sometimes this ball-detent system can become stuck in the out position while a socket is stuck on it, making the socket almost impossible to remove.
Look at your ratchet and determine if it is a quick-release model. If your ratchet has a button on the top of the end where the socket attaches, you have a quick-release ratchet. Depress the button to release the socket and pull it off.
Pull hard on the socket to remove it, if your ratchet is not the quick-release type.
Clamp the socket and wrench in a vise, if your socket is still stuck on -- on either a quick-release or a regular ratchet -- with the socket coming in from the side and the ratchet handle parallel to the floor.
Hold the end of the ratchet handle and hit middle of the ratchet handle with a hammer until the ratchet releases.