magento2.3 – How to get product Quantity in Magento 2

I need to retrieve product quantity, I found the interfaces we used before to get product quantity are deprecated, these are:

MagentoCatalogInventoryApiStockStateInterface $stockItem

And,

MagentoCatalogInventoryApiStockRegistryInterface $stockRegistry

Below link says StockStateInterface is replaced with Multi Source Inventory but I cannot see a function returning product quantity in it.

https://www.magentoextensions.org/documentation/interface_magento_1_1_catalog_inventory_1_1_api_1_1_stock_state_interface.html

Is there some other way to get product quantity? I don’t want to use deprecated code.