There are special rules for donation of inventory to charity depending on the type of entity the business is.
https://kahnlitwin.com/blogs/tax-blog/what-are-the-rules-for-charitable-contributions-of-inventory#:...
other methods - sell what you can at a profit
1) throw the rest in the trash - i would take pictures just in case of an IRS inquiry
2) look up scavengers in your area. some might buy that inventory for pennies on the dollar but there are no shipping costs.
in other words, to take a write off you have to get rid of that inventory before the business is closed.