The Cost of goods sold account(s) records all the expenses that are attributable (directly or indirectly) to develop a product and bring it in a form that is easily marketable and can be sold.
For example, buying raw materials is an expense and it’s recorded in the cost of goods sold (cost of sales). The cost of sales is basically a reconciliation of the stock that you have in the beginning of the year, the purchases you made during the year and the closing stock for this year.
To be more precise, the cost of sales or the cost of goods sold as it’s also called can be calculated as follows:
Cost of Sales= Opening Stock + Purchases for the year – Closing Stock.