The first basic class of voltage regulators are series linear regulators. These types of regulators are available in discrete and integrated circuit forms. A zener diode is a classic example of a linear regulator using discrete components. The figure below shows that a 5 V Zener regulates the output at node VZ once the input reaches 5 V and beyond.
A basic series voltage regulator can be designed using op-amps. The figure below shows an example. As the output voltage changes due to load changes, the inverting terminal of the op-amp changes as well in proportion to the voltage divider's resistor sizes. If the output falls, the op-amp's negative input falls as well, lifting the op-amp output higher. As a result of that, the NPN (pass transistor) turns on strongly pulling more current from the input to the output. This results in bringing the output voltage back up. The desired output voltage is simply the amount of the reference voltage (VREF) as a function of the resistor divider. This feedback mechanism ensures the output stays relatively constant in response to the output changes.
The example below demonstrates the output voltage value for a given set of input voltage, reference and resistor values. Note the series regulator in this example can only "step down" from the input voltage, i.e. the output voltage is less than the input voltage.
Reference voltage = 5 V
VIN = Input voltage = 15 V
VOUT = 5 V ((10 K + 10 K) / 10 K) = 5 V X 2 = 10 V