1. Navigate to your Store Settings
2. Enable Inventory Control

Check the "Use Inventory Control" checkbox.
3. Set "Out of Stock Behavior"
The "Out of Stock Behavior" field controls how (or if) a product will be displayed in the store catalog if it is out of stock AND Use Inventory Control is enabled.
Possible Values
Display item as out of stock and allow customer to purchase it
Display item as out of stock do not allow customer to purchase it
Display item in product catalog and allow customer to purchase it
Do not display item in product catalog
4. Set "Out of Stock Indicator"
This field only appears when you have chosen either of the first two values above for "Out of Stock Behavior". It controls what will be displayed to the customer below the product in your storefront, when it is out of stock. This field will accept HTML or plain text.