How to use wysiwyg text editor (text_format) in a system configuration form
$form['distance_selling_terms'] = [
  '#type' =&gt; 'text_format',
  '#title' =&gt; $this-&gt;t('Distance Selling Terms'),
  '#description' =&gt; $this-&gt;t('Enter Distance Selling terms'),
  '#default_value' =&gt; config-&gt;get('distance_selling_terms.value'),
  '#format' =&gt; $config-&gt;get('distance_selling_terms.format'),
];


And if you want to limit the wysiwyg editor to only the one format, add #allowed_formats as in:

$form['distance_selling_terms'] = [
  '#type' =&gt; 'text_format',
  '#title' =&gt; $this-&gt;t('Distance Selling Terms'),
  '#description' =&gt; $this-&gt;t('Enter Distance Selling terms'),
  '#default_value' =&gt; config-&gt;get('distance_selling_terms.value'),
  '#format' =&gt; $config-&gt;get('distance_selling_terms.format'),
  '#allowed_formats' =&gt; [
    $config-&gt;get('distance_selling_terms.format') =&gt; 'Description of format'
  ],
];