One can build a potential divider using two variable resistors. But it is easier to just buy a standard component called the potentiometer. A potentiometer has three terminals. Two of them are connected to both ends of a uniform resistive element. The third terminal is a sliding contact, called a wiper. It can be slid along the resistive element so we can make contact with any point along the resistive element.
When connected across a voltage source, a potentiometer can be used to provide a variable output voltage Vout.
As illustrated below, by manually adjusting the position of the sliding contact, we can vary x, the length of resistive element that Vout is connected across.
As a result, Vout can be varied between 0 and Vin.
Vout can then be used as a signal to control the brightness of a lamp, or the volume of the stereo, etc.
We can also build a temperature sensing circuit by connecting a fixed resistor and a thermistor as a potential divider.
For example, the thermistor in the above circuit can be mounted on your laptop’s CPU so that the thermistor has the same temperature as the CPU. Since the resistance of the thermistor decreases with temperature, the fixed resistor grabs a larger share of Vin as the CPU gets hotter. Vout could thus be used as control signal (to an input pin on a microcontroller perhaps) to turn on the cooling fan when the CPU is too hot.
We can also build a brightness sensing circuit by connecting a fixed resistor and a LDR as a potential divider.
For example, the LDR in the above circuit can be mounted on a street lamp. Since the resistance of the LDR varies with ambient lighting, the PD across the LDR also varies according to the potential divider principle (Vout is larger when it is darker). Vout could thus be used as control signal (to an input pin on a microcontroller perhaps) to decide when to turn on or off the street lamp.