Due to excessive car usage, pollution and traffic have increased. In urban cities in Saudi Arabia, such as Riyadh and Jeddah, drivers and air quality suffer from traffic congestion. Although the government has implemented numerous solutions to resolve this issue or reduce its effect on the environment and residents, it still exists and is getting worse. This paper proposes an intelligent, adaptive, practical, and feasible deep learning method for intelligent traffic control. It uses an Internet of Things (IoT) sensor, a camera, and a Convolutional Neural Network (CNN) tool to control traffic in real time. An image segmentation algorithm analyzes inputs from the cameras installed in designated areas. This study considered whether CNNs and IoT technologies could ensure smooth traffic flow in high-speed, high-congestion situations. The presented algorithm calculates traffic density and cars' speeds to determine which lane gets high priority first. A real case study has been conducted on MATLAB to verify and validate the results of this approach. This algorithm estimates the reduced average waiting time during the red light and the suggested time for the green and red lights. An assessment between some literature works and the presented algorithm is also provided. In contrast to traditional traffic management methods, this intelligent and adaptive algorithm reduces traffic congestion, automobile waiting times, and accidents.