As part of the master's thesis, we presented the preventive mentainance of the packaging line, as pharmaceutical companies are facing an increase in the capacity of production processes and therefore have more congestion and breakdowns. We have developed a production optimization model consisting of three phases. The first phase is an inventory of the working asset. The second phase is the care of the working tool, which includes the 5S method and the entire documentation of the working tool. The third phase focuses on the maintenance of the working asset. For each component of the working medium, the type of maintenance is selected and the criticality of the spare parts is determined. The criticality of spare parts determines the planning system and the stock of spare parts. The FMECA method and the criticality determination system based on FMEA analysis and TPM program were introduced. With the described maintenance model, we managed to reduce congestion, breakdowns, stocks of spare parts in the warehouse and reduce production costs on the packaging line in the company.