This paper develops an economic production quantity (EPQ) model considering predictive maintenance and trade credit with an imperfect production process. Predictive maintenance, with the help of sensors and data analysis, can execute maintenance before the system becomes out of control and can improve system reliability. We also consider a trade credit policy that allows manufacturers to delay their payments. Based on the relationships among production runtime, inventory cycle time, and credit period, we divide the model into three cases. The objective is to determine the optimal production runtime and predictive maintenance effort to maximize the total expected profit. We develop a piecewise nonlinear optimization algorithm to solve the problems described. Based on numerical experiments, we discuss the influences of system parameters on decisions and profit. The results of this study can serve as references for business managers and administrators.