When the product is out of stock, the customer cannot buy the product. It's not good for sale. However, don't worry about it. Now customers still buy even when products out of stock by using Pre-orders features.
You can check on this demo: https://kalles-demo.myshopify.com/products/ribbed-stripe-top
You need to do as these steps:
Go to Products > Choose the product you want to set > Enable "Continue selling when out of stock" option
Clicking on 'Incoming' > Add a transfer
Add quantity incoming for product > click to "Save"
Now go to Preview link Product, you'll see the button display: