Please add the below code in your custom module :
app/code/Vendor/Module/view/frontend/layout/catalog_catagory_view_type_layered.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<attribute name="class" value="page-with-filter"/>
<referenceContainer name="sidebar.main">
<block class="Magento\LayeredNavigation\Block\Navigation\Category" name="catalog.leftnav" before="-" template="Magento_LayeredNavigation::layer/view.phtml">
<block class="Magento\LayeredNavigation\Block\Navigation\State" name="catalog.navigation.state" as="state" />
<block class="Magento\LayeredNavigation\Block\Navigation\FilterRenderer" name="catalog.navigation.renderer" as="renderer" template="Magento_LayeredNavigation::layer/filter.phtml">
<arguments>
<argument name="product_layer_view_model" xsi:type="object">Magento\LayeredNavigation\ViewModel\Layer\Filter</argument>
</arguments>
</block>
</block>
</referenceContainer>
<move element="catalog.navigation.state" destination="content" before="category.products" />
</body>
</page>
Then override the Navigation.php file and edit in the following function
and then add the following in the navigation.php file
Vendor/Module/Block/Navigation.php
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\LayeredNavigation\Block;
use Magento\Framework\View\Element\Template;
use Magento\Catalog\Model\ResourceModel\Product\Collection;
use Magento\Catalog\Block\Product\ProductList\Toolbar;
/**
* Catalog layered navigation view block
*
* @api
* @since 100.0.2
*/
class Navigation extends \Magento\Framework\View\Element\Template
{
public function getClearUrl()
{
return $this->getChildBlock('state') ?$this->getChildBlock('state')->getClearUrl():"";
}
}
?>
Then create the di.xml file and override the Navigation.php file using the preference method
Vendor/Module/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\LayeredNavigation\Block\Navigation" type="Vendor\Magento\Block\Navigation" />
</config>
Now, Add Magento_LayeredNavigation in the sequence tag of your module.xml file
<?xml version="1.0"?>
<!--/**
* Copyright © 2020 Grazitti . All rights reserved.
*/-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Vendor_Magento" setup_version="2.0.3">
<sequence>
<module name="Magento_LayeredNavigation"/>
</sequence>
</module>
</config>