A novel prognostic approach was developed and applied to a machine tool hydraulic unit. Three components were considered: pump, sensor and valve. The proposed methodology exploited a digital twin of the system to perform simulations of the healthy and faulty machine. The digital twin was properly validated through experiments. This approach dealt with the need to carry out time-consuming and expensive experimental campaigns, that is, run-to-failures – not affordable in many industrial applications. The diagnosis module was trained on digital twin simulations and fulfilled the fault detection, isolation and quantification phases. The challenge related to the variability of the operating conditions of the machine was addressed through a robustness analysis of the methodology. The solution successfully dealt with both stationary and non-stationary working conditions. A dedicated classification model was designed for each faulty component, maximising the associated classification rate. The testing procedure consisted of the application of a 10-fold cross-validation to compute the mean classification rates for stationary and non-stationary working conditions. Diagnosis performance results were excellent for the pump, whereas they were lower for the sensor and valve, reaching 79.75% and 74.93% accuracy respectively for the most challenging working cycle. The prognosis directly exploited the output of diagnostics, allowing for experimental effort reduction. Prognosis predictions were built starting from the updated health status provided by the diagnosis output. In order to test the prognosis module, mean and standard deviation of the prediction errors (less than 1.176%) were computed through a Monte Carlo approach. The conceived methodology allowed one of the critical goals of prognostics to be handled: the Remaining Useful Life probability density function estimation.