For that you have to create system.xml file in your module.
Path for this file is app/code/{vendor}/{modulename}/etc/adminhtml/system.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<tab id="tab_id" translate="label" sortOrder="10">
<label>{vendor}</label>
</tab>
<section id="sectionid" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
<class>separator-top</class>
<label>XYZ</label>
<tab>tab_id</tab>
<resource>Vendor_Modulename::sectionid_config</resource>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>General Configuration</label>
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Module Enable</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
</group>
</section>
</system>
</config>
Now you have to set default value
for that create config.xml file at app/code/{vendor}/{modulename}/etc/config.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<sectionid>
<general>
<enable>1</enable>
<display_text>XYZ</display_text>
</general>
</sectionid>
</default>
</config>
This will display configuration in admin. After that you have to fetch value of enable/disable in controller using helper.