Solid waste management has become a significant global environmental challenge that affects both ecosystem sustainability and human well-being. The increasing volume of waste generated from daily human activities highlights the urgent need for technology-based solutions that support efficient waste sorting, recycling, and resource recovery. This study proposes an automatic waste classification system using the YOLOv8 algorithm, a state-of-the-art deep learning model capable of performing real-time object detection with high accuracy. A dataset consisting of 1,800 labeled waste images representing five main categories plastic, glass, metal, paper, and organic was used for model training and evaluation. To enhance performance, the One Factor at a Time (OFAT) approach was applied for hyperparameter optimization, focusing on learning rate, batch size, and number of epochs. Two models were compared: the default YOLOv8 configuration and the optimized YOLOv8 OFAT model. Experimental results show that the optimized YOLOv8 OFAT achieved a mAP@0.5:0.95 of 86.1%, slightly higher than the default YOLOv8 model with 85.8%. Although the improvement of 0.3% appears modest, it indicates better model consistency and reliability across various data conditions. The integration of the OFAT technique into YOLOv8 represents a novel contribution, demonstrating that systematic hyperparameter tuning can significantly enhance the efficiency and robustness of automated waste detection systems, thereby supporting environmental sustainability and the realization of a green economy.