Traffic lights were in use before there were motorcars
Traffic lights were used before the advent of the motorcar. In 1868, a lantern with red and green signals was used at a London intersection to control the flow of horse buggies and pedestrians.
When motorcars were introduced to the US in the late 1890s, Police Officer William Potts used railroad signals for street traffic, adding the amber light. His electric traffic lights were installed in 1920 in Detroit, Michigan, USA. They were manually controlled. The first automatic traffic light was invented later in 1920 by Garrett Morgan and first used in Cleveland, Ohio, USA.
Isn't it amazing that, after all these years, the only thing that can stop a 30-ton truck is a traffic light.