Get system config data
In this article i will help you about How to get value from system config in Magento 2. For getting value from system Configuration, we need to create a object of \Magento\Framework\App\Config\ScopeConfigInterface class in block file.
<?php
namespace Mageniks\Alltest\Block;
class Alltest extends \Magento\Framework\View\Element\Template
{   
     public $_scopeConfig;
       
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,       
       \Magento\Framework\App\Config\ScopeConfigInterface $scopeInterface,       
        array $data = []
    )
    {   
        $this->_scopeConfig = $scopeInterface;
        parent::__construct($context, $data);
    }
}       


 
As we can see in above code, I have created $this->_scopeConfig object. Using this object we can get the config data in phtml file. Please check below code.
       
$enablemodule =  $this->_scopeConfig->getValue('slider/general/enablemodule', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);


 
'slider/general/enablemodule' : This is the path of field or element in system.xml. 

That's it. Now we have successfully get value config data in $enablemodule variable.