addtocart – Magento 2 How to disable the Add to Basket button for out of stock items

Magento 2.3

I have a third software that I use for inventory management, so you do not need Mangeto to manage my inventory.
If I set the stock option to No, the Add to Cart button on the product page is always displayed even if the quantity in stock is zero.

How can I disable the Add to Cart button or even hide the product when the stock reaches zero?

I already set the option Products out of stock on the display, but that did not help.

Any advice greatly appreciated