how to add a new custom tab in the product detail page in magento2
Magento_Catalog/layout/catalog_product_view.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product.info.details">
<block class="Magento\Catalog\Block\Product\View\Attributes"
name="product.custom-info.tab"
as="custom-info.tab" template="Magento_Catalog::product/view/custom.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">CUSTOM TAB</argument>
<argument name="sort_order" xsi:type="string">20</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
Magento_Catalog/templates/product/view/custom.phtml
<?php
echo $this->getLayout()
->createBlock('Magento\Cms\Block\Block')
->setBlockId('custom-info')
->toHtml();
?>