In the contemporary era of rapid technological advancement, the Industrial Internet of Things (IIoT) has become a pivotal element in revolutionizing industrial operations. This paper delves into the escalating cybersecurity challenges posed by the sprawling networks of IIoT, accentuating the inadequacy of traditional cybersecurity methods in the face of sophisticated cyber threats. We introduce machine learning (ML) as a transformative approach to fortify the cybersecurity landscape of IIoT systems. Our research primarily focuses on the application of machine learning algorithms to detect, analyze, and counteract diverse cyber threats in IIoT environments. These algorithms are trained to recognize and respond to a spectrum of cyber threats, thereby enhancing the resilience of IIoT networks. We present a novel Convolutional-GRU autoencoder model, which demonstrates superior performance over traditional machine learning models in terms of accuracy, precision, recall, and F1score. This model is adept at learning and adapting from complex data patterns, ensuring robust defense against cyber intrusions. We also address the challenges in applying ML to IIoT cybersecurity, considering the varied nature of IIoT devices and the dynamic landscape of cyber threats. This study is an important stride towards enhancing IIoT cybersecurity, highlighting the symbiotic relationship between ML and IIoT. It serves as a foundation for future research and a guide for current implementations, aiming to create more secure, reliable, and efficient IIoT environments. By exploring the potential of ML in cybersecurity, we pave the way for a new era in industrial digital protection, one that is adaptable, forward-thinking, and resilient against the ever-evolving digital threats.