Usually the belayer will achieve this by using a [belay device]? attached to the harness through which the rope runs. A [climbing eight]? is a popular belay device. The eight allows the belayer to control the amount of friction applied to the rope, which varies from very little when the rope needs to move, to enough friction to stop a fall. There are many varied belay devices: [gri gri]?, [sticht plate]?, tuber?, various proprietary trade names. Some climbers do not use a belay device, a sliding knot known as the [italian hitch]? (also known as friction hitch or muenter hitch) can be used.
The protection that climbers use varies but the basic idea is to run the rope through a point that is secured to the rock; if the leader should fall they will fall twice the distance from them to their last piece of protection that stayed in place (plus the stretch of the rope), hopefully this is a sufficiently short distance to prevent them from hitting any large ledge or the floor.