Some traffic lights have a control mechanism that allows the ambulance drivers to change the traffic lights from red to green with a remote control inside the ambulance.
Some other traffic lights contain a sensor that senses the ambulances sirens and then when it detects the ambulance or other emergency vehicles sirens the light changes so that the ambulance or other emergency vehicle can get through.