How do I update the section component configuration? How to update a component in the node's layout builder? I  have used the following code.
$node = \Drupal\node\Entity\Node::load($nid);
$layout = $node-&gt;get('layout_builder__layout');
$sections = $layout-&gt;getSections();
foreach ($sections as $key =&gt; $section) {
      $components = $section-&gt;getComponents();
      foreach ($components as $component) {
        if ($component instanceof SectionComponent &amp;&amp; $component-&gt;getPluginId() === 'myplugin_id') {
          $configurations = $component-&gt;get('configuration');
          $configurations['label_display'] = &quot;0&quot;;
          $component-&gt;setConfiguration($configurations);
        }
      }
}

But now I don't know how to update the section and layout of the node.
Because $section-&gt;setComponent($component) is a protected method.
I have done it like this.
$node = \Drupal\node\Entity\Node::load($nid);
$layout = $node-&gt;get('layout_builder__layout')-&gt;getValue();
$sections = $layout-&gt;getSections();

foreach ($sections as $key =&gt; $section) {
  $components = $section-&gt;getComponents();
  foreach ($components as $component) {
    if ($component instanceof SectionComponent &amp;&amp; $component-&gt;getPluginId() === 'myplugin_id') {
       $configurations = $component-&gt;get('configuration');
       $configurations['label_display'] = &quot;0&quot;;
       $component-&gt;setConfiguration($configurations);
    }
  }
}

$node-&gt;set('layout_builder__layout', $layout);
$node-&gt;save();