Spare parts management has gained significant attention in recent years due to the considerable costs associated with backorders or excess inventory. This article addresses the challenge of determining the optimal number of spare parts to stock, assuming that the parts can be repaired. When an item fails, it is promptly sent for repair in a workshop. The time between failures and the repair time are assumed to follow an exponential distribution, although it should be noted that the results could be adapted to other distributions as well. This study introduces a heuristic method to find the optimal inventory level that minimizes the total cost, considering holding inventory, backorder, and repair costs. The research offers a valuable decision-making framework for determining the number of spare parts needed to minimize inventory costs, based on just two parameters: (1) the ratio of time to repair and time to failure, and (2) the ratio of the inventory holding cost of a spare part per day to the daily cost of an idle machine. To the best of our knowledge, there are no similar methodologies in the existing literature. The proposed method is straightforward to implement, employing graphs and simple computations. Therefore, it is anticipated to be highly beneficial for practitioners seeking a quick and reliable estimator of the optimal number of spare parts to stock for critical components.