I have try the code but it was not working as of now do you have any further clarification?
this code for the getting the product from the collection
option 1
{%- for product in collection.products |'sort_by=inventory' -%}
option 2
{%- for product in collection.products | sort: 'available' -%}
Error I am getting into the theme kit CLI.
main-collection.liquid) Liquid syntax error (line 217): Expected end_of_string but found pipe in “product in collection.products | sort: ‘available’”