IoT is one of the most important technologies that are used over the past few years, where everything is connected to the Internet; it is used in many fields; one of these fields is healthcare system that includes mobile health and remote patient monitoring (patients with kidney, heart disease, cancer, blood pressure, diabetes, respiratory disease and stroke). Integration of IoT and cloud computing can improve the performance of healthcare system and the development of the innovative applications in future. One of the major problems that cannot be ignored in cloud computing system is load balancing. Solving that problem leads to reduce the response time, power consumption, cost and increase server availability. This paper is comprised of two parts which are creating and implementing healthcare system by using IoT, and solving the problem of load balancing of the cloud computing by using intelligent algorithm called sparrow search algorithm (SSA). The SSA is used to select the best virtual machine (VM) among a group of VMs depending on the its fitness value; also many and varied tasks are scheduled with priority and assign to the best VMs depending on the its instruction millions (IM), where the task that has high IM is assigned to the best VM that has high fitness value. The outcomes demonstrated that the proposed method focuses to reduce the latency and packet loss while maximizing the throughput in healthcare systems; also the SSA has proved its robustness, efficiency and success when compared to other methods in terms of reducing makespan time, total processing time and provides load balancing among VMs, where the value of makespan time, processing time and degree of imbalance has decreased into (23.05), (899.8979) and (177.7675), respectively, in case of applying 500 tasks.