Among the castles with a moat, most had a draw bridge -- a removable wooden structure leading up to the main entrance at the gatehouse. If the moat was wide, there was usually had a timber bridge, resting on piers of wood or stone, which spanned part partway across and met the drawbridge (or where it would be in open position).
The simplest, most primitive drawbridges were just manhandled into and out of position. Some came to be pushed backward or forward on rollers. Still evolving, the drawbridge eventually came to be raised by chains that were attached to it's outer corners, sloped up through holes into the gatehouse, and were wound onto a windlass. An alternate of this design was raised by chains hanging from a pair of rainures or gaffs -- timber beams received back into long chases or slots in the gatehouse.
Around the 14th century, the counterbalanced drawbridge or "turning bridge" came into use. The turning bridge spanned moat as well as a deep stone pit built into the gatehouse entranceway. When the bridge turned on it's pivot to close, the outside half was drawn up against the castle wall while the inside half went down into the pit. This solved the problem of having to lift the extremely heavy wooden platform. It also greatly increased the defensive effectiveness of the gatehouse by adding an impassible (that is, when it need to be) pit in the entrance way. Clear examples of the turning bridge can be found at Kildrummy Castle in Aberdeenshire and Queen's Gate at Caernarvon Castle.