How to add an option in the "Sort by" drop down menu

I want to add an option for the available inventory in the “Sort by” drop-down menu. The reason is that the option in the menu right now doesn’t allow what’s in stock to come out at the top and I can’t continue to do it manually.

Correct.

You can not, because there are a limited number of “sort by” options engineered into the Shopify COLLECTIONS array.

However… check out this post for some details on how I was able to handle “sort by inventory”

I was not satisfied by any of the answers in the community so I put this post together showing how to modify the template code to order by stock. I think this should be built into Shopify

https://community.shopify.com/c/shopify-discussions/sort-by-stock-push-out-of-stock-to-bottom-of-list-feature/td-p/1785852

This “human idea” seems like common sense: “Push out of stock items to the bottom”

However, after trying to make this happen I do indeed see why Shopify has ignored this… with enough community support we could help bring this feature to Shopify’s attention, and with the right DEV team on their end a good solution could be reached by enhancing the Shopify core code and collection array. (further details in link above)

Good luck.