Task scheduling is one of the main problems in cloud computing. Proper utilization of resources is promoted through cloud computing, and a well-planned task schedule can result in efficient use of resources. To improve the overall performance of the cloud system, task scheduling and resource allocation have become basic needs to efficiently and effectively balance workloads among cloud resources. This paper proposed the Gorilla Troops Optimization-Task Scheduling (GTO-TS) algorithm depending on the artificial Gorilla Troops optimizer (GTO). The experimental evaluation used Cloudsim Simulator and comparison of its results with four methods: Minimum Execution Time (MET), Minimum Completion Time (MCT), Minimum- Minimum (Min-Min), and Maximum -Minimum(Max-Min). The proposed algorithm (GTO-TS) distributes the workload evenly among the virtual machines (VMs) to reduce Makespan and optimize resource usage. The suggested algorithm (GTO-TS) outperformed the four traditional algorithms in terms of effectiveness, as demonstrated by the simulation results.