Most elevators work just like a pulley. A very strong metal rope is joined to the top of the elevator car and goes up through a “sheave” in the engine room above the elevator. The sheave is like a pulley wheel with grooves in it to hold the rope tightly. On the other side of the rope is a weight, which is about as heavy as the elevator car when it is half full. This balances the car, so that not too much energy is needed to move it.
Both the weight and the elevator car are held in place by guide rails at the sides of the elevator shaft (the tunnel the elevator is in). A motor can turn the wheel in either direction so that the elevator either goes up or down (with the weight doing the opposite). When you push the button inside the elevator, you activate the motor. When the motor stops, the grooves in the pulley wheel keep the rope in place so the elevator stops moving.