Mastering Inventory is mastering its accounting. Inventories are assets, and COGS are the related expenses. Merchandising inventory is purchasing near finished or finished forms, where manufacturing production requires Raw Materials, Direct Labor, Manufacturing Overhead, Work-In-Process, and Finished Goods components.
Perpetual Inventory Systems continually adjusts inventories for each change caused by purchases, sales, or returns; where COGS are effectively adjusted for a sale or return for a customer. Perpetual Systems help determine goods on hand and on demand (by date).
This will help determine the items sold during any period. Typically, when products are purchased on accounts, you will Debit Inventory, and Credit AP upon purchase of the inventory. Then to record the sale you will Debit AR and Credit Sales Revenue. While for COGS you will Debit COGS and Credit Inventory.