you can track inventory number of your items. Once the inventory becomes zero, customers are unavailable to add to cart anymore.
Please mind that this is advanced feature and most of sellers may not need to use. It is good for some sellers who have very limited stocks with high demands.
Once you start setting the inventory level, you should consistently manage the numbers. Some customers made order but do not make payment. In this case, you should reverse the deducted inventory manually.