Efficient resource allocation is crucial in fog computing environments due to dynamic conditions and different user requirements; this work addresses the scheduling issues of internet of things (IoT) applications in such situations. Our proposed method, chaotic crossover tuna swarm optimizer (CCTSO), is based on metaheuristics and aims to reduce energy usage, reaction time, and SLA breaches; it should help with these problems. Improved system responsiveness and dependability are outcomes of the suggested approach's use of machine learning models for scheduling decision prediction and dynamic workload adaptation. The framework achieves a good balance between performance and energy efficiency by adjusting critical parameters and application settings. By reducing energy usage, reaction time, and operational cost while retaining reduced service level agreement (SLA) violation rates, our solution greatly outperforms previous techniques, according to experimental assessments. In real-world implementations, our results demonstrate that CCTSO is a strong solution for fog-based IoT scheduling, providing greater scalability and adaptability. Taken together, the results of this study provide a strong algorithmic foundation for better resource management in cloud, fog, and edge computing environments.