How to clear cache for config entity after making changes?
Yes, you have to add the cacheable dependencies of the config object, not only to the form, but also to the render array in preprocess, so that the rendered output gets the correct cache data:

function mymodule_preprocess_node(&amp;$variables) {
  $config = \Drupal::config('mymodule.settings');
  $config_value = $config-&gt;get('some_field');
  // add the cache tag, so that the output gets invalidated when the config is saved
  \Drupal::service('renderer')-&gt;addCacheableDependency($variables, $config);

  $library = 'mymodule/some-library';

  if($config_value == 'some_value') {
    $variables['#attached']['library'][] = $library;
  }
}