Most of the preparers on the forum are dealing with small taxpayers (under $26M gross receipts as adjusted for inflation, over prior 3 years). Just have an easy life and treat the Inventory as section 471(c) NIMS inventory method (Non-Incidental Materials and Supplies).
You buy the peanut butter to make the cookies in December. You capitalize the peanut butter. You sell the peanut butter cookies in January. You expense the peanut butter in January. Example, Reg. §1.471-1(b)(4)(iv)
If the taxpayer opts to treat inventory as non-incidental materials and supplies, the taxpayer initially capitalizes the items that would have made up inventory and then recovers the costs in the LATER of the taxable year when:
Such inventory is actually used or consumed in the taxpayer’s business, which is the the taxable year in which the taxpayer provides the items to its customer; or
The taxable year in which the taxpayer pays for (for a taxpayer using the overall cash method of accounting) or incurs (for a taxpayer using the overall accrual method of accounting) the costs of the items.
But yes, you can also make your life difficult and do inventory as a book method and then you do have to follow it for tax. But why.
This articles discusses inventory exception in more detail
https://www.currentfederaltaxdevelopmen ... format=amp