What to do when you cannot sell something any more.
TEMPORARILY OUT OF STOCK
Set the stock status to Out of stock. The product page stays live, showing it as unavailable.
Keeping the page preserves its search ranking and any links pointing at it. Hiding it loses both, and you will want them back when stock returns.
Consider allowing backorders if customers will wait.
ADD A NOTIFY-ME OPTION
A plugin that emails customers when stock returns turns a lost sale into a delayed one, and tells you what demand exists.
PERMANENTLY DISCONTINUED
Do not simply delete it. A deleted product page returns a 404 to anyone following a link or a search result.
Better: set it to draft and redirect the URL to the closest alternative or to its category. A redirect plugin handles this.
If the product might return, leave it out of stock instead.
SEASONAL PRODUCTS
Leave them published and out of stock rather than deleting each year. The page accumulates ranking across seasons.