Scenario 1: You want to prevent your customers from buying a sold-out variant (color, size etc)
Answer: You can disable sold-out variants from being selected by your customers, or remove them from a product page by editing your theme's HTML/CSS. You do not need any app for that. See this link below for instructions:
https://docs.shopify.com/support/your-store/products/how-do-i-remove-sold-out-variants
Scenario 2: You want to hide sold-out products to clear out old inventory or for SEO reasons
Answer: There's an app for that!
FREE! Hide sold-out products for free.
Pay only to perform Hide & Publish "Automatically" every day