To know the cost of goods sold, you need to know the cost of materials and outputs cost. The cost of material is calculated by noting the amount it takes to acquire materials used in product manufacture. And Cost output is the total cost of sold goods.
To use this, simply say: Cost of Materials & Inventory – Cost of Outputs
It means you'll remove the cost of outputs from the cost of materials. This helps to determine if the cost paid for production commensurate with the selling amount.