For purposes of this thought experiment, imagine that a car could be traveling at the speed of light. (It can't but let's imagine it.)

Let's also imagine that the driver is holding a clock, and a meter stick pointed in the direction of travel.

From the perspective of the driver, the clock is ticking as usual, the meter stick is one meter long, and the light streams from the headlights at the speed of light, as usual.

From the perspective of an external observer, the clock is stopped, the meter stick has zero length, and the light is traveling at the speed of light, which means that it never leaves the headlights of the car, since the car is also traveling at the speed of light.

The premise of special relativity is that light always travels at light speed in any inertial (non-accelerated) reference frame. For this to be true, when one frame is moving in relation to another, the lengths and time intervals adjust in order to keep this so.

For a second example, let's imagine the car is traveling at half the speed of light.

From the perspective of the driver, the clock is ticking normally, the meter stick is one meter long, and the light streams from the headlights at the speed of light.

From the perspective of an external observer, the clock ticks once every 1.155 seconds, the meter stick is 86.6 centimeters long, and the light from the headlights travels at the speed of light, and since the car is traveling at half the speed of light, the light separates from the headlights at half the speed of light.