Where do I write off Obsolete Inventory which I have either trashed or donated ? Thank you.

Does it get deducted from the Purchased Inventory for the year or or somewhere else?