The Enforce Stock module ensures that customers cannot add products to their cart which are out of stock. It also lowers the amount to the amount in stock if the customer tries to order more than are available (for example, if 3 items are in stock but the customer tries to add 5 to their cart, the cart will still have 3 items in it).