In fog computing, load balancing is an important research problem. It focuses on efficiently assigning tasks to fog nodes and minimizing delay in real-time applications. The traditional round-robin algorithm assigns tasks in a rotating manner among fog nodes, but it can send tasks to the cloud too early, leading to increased delays. To solve this problem, this paper introduces an improved round-robin algorithm that takes a dynamic approach to balancing the use of fog resources. The new model aims to improve load balancing in fog computing by distributing tasks more evenly among fog nodes, reducing dependence on cloud computing, and making better use of fog resources. The improved algorithm helps fog computing systems run more efficiently, reduces delays in real-time applications, and lowers the costs associated with cloud use. The results show that the proposed load balancing algorithm is key to optimizing fog resource use, improving system efficiency, and reducing task completion times in distributed computing systems.