The rapid advancement of 5G networks, coupled with the increasing complexity of resource management, traffic handling, and dynamic service demands, underscores the necessity for more intelligent network optimization techniques. This paper comprehensively reviews AI-driven methods applied to 5G network optimization, focusing on resource allocation, traffic management, and network slicing. Traditional models face limitations in adapting to the dynamic nature of modern telecommunications, while AI techniques—particularly machine learning (ML) and deep reinforcement learning (DRL)—offer scalable and adaptive solutions. These approaches facilitate real-time optimization by learning from network conditions, predicting traffic patterns, and managing resources intelligently across virtual network slices. The integration of AI into 5G networks enhances performance, reduces latency, and ensures efficient bandwidth utilization, which is essential for supporting emerging applications such as the Internet of Things (IoT), autonomous systems, and augmented reality. Furthermore, this paper highlights key AI techniques and their applications to 5G challenges, illustrating their potential to drive future innovations in network management. By laying the groundwork for autonomous network operations in 6G and beyond, this research emphasizes the transformative impact of AI on telecommunications infrastructure and its role in shaping the future of connectivity.