Job Shop Scheduling (JSS) is considered an optimization problem for implementing optimal job scheduling. Different techniques such as mathematical optimization or simulation-optimization have been used for the optimization of the JSS problem. However, Industry 4.0 and new developments in technologies such as the Industrial Internet of Things (IIoT) and Cyber-Physical System (CPS) caused the introduction of the digital twin technology which is considered a new method for optimization of the JSS problem. The digital twin technology provides a cloud-based simulation model to make use of the real-time data provided by the IIoT and CPS from physical space. Additionally, the digital twin technology applies Machine Learning (ML) techniques to build prediction models and uses powerful cloud computing to do real-time what-if analysis, rescheduling, and response for optimization of the JSS. In this thesis, we apply the digital twin concepts to a case study which is the stamping shop of AAL company to optimize its JSS problem. We build a JSS simulation model of the stamping shop manufacturing processes, use ML techniques to predict the probability of machine breakdowns through the real-time data captured from the sensors, and consider a Condition-Based Maintenance (CBM) process to optimize the JSS by reducing unexpected machine failures during operation. Comparing the results of the digital twin technology with the traditional simulation-optimization technique used in the ALL company, the digital twin is a more efficient approach for optimizing the JSS problem by providing an accurate prediction model and implementing CBM scenarios to reduce unplanned machine failures.