There are four types of coil springs, each with its own purpose: torsion, tension, spiral, and compression.
The most common type is a torsion spring, where both ends are connected to different components to maintain a specific angle. For example, in a door hinge, the spring stores rotational energy when the door opens. When released, the stored energy returns the door to its original position.