Say you had closing stock of £1k then your journal to incorporate would be
Dr Stock (BS) £1k
Cr Stock (P&L) £1k
If you decided to write of say £200 of the stock as old/bad then you would show £800 as closing stock then the journal would be
Dr Stock (BS) £800
Cr Stock (P&L) £800
As closing stock is only a period end adjustment then any write off of the stock isnt shown anywhere. All you are doing is reducing the period end journal which you would have originally posted.