Hello,
Navigate to WooCommerce -> Settings -> Products -> Inventory and enable the “Hide out of stock items from the catalog” option: https://prnt.sc/zmUPgiKp0f-3. This will hide the out-of-stock from the catalog.
But if you want to remove the hide of stock products from the related section area, Try to use the theme’s Layout Builder to create Custom Layout for the Single Product page and use the Products (grid or carousel) element and enable the option “Hide Out of Stock Products” https://ibb.co/j91sqkxW
Further, you can read more about the Layout Builder here: https://xtemos.com/docs-topic/woodmart-woocommerce-layout-builder/
Best Regards,