Load id of paragraph in hook_preprocess_layout using load($id) method I want to load the paragraph id in theme preprocess.

function theme_preprocess_layout(&amp;$variables) {
  $ID = $variables['content']['#paragraph'] ???; "contents - protected 'id' =&gt; array(1) = 68"
  $variables['attributes'] = new Drupal\Core\Template\Attribute($variables['attributes']);
  $variables['attributes']-&gt;addClass($ID);}


It gives me the available method "load($id)" but I don't know how to implement this method.
Thanks to Beau for the help.
The method is simply  

$ID = $variables['content']['#paragraph']-&gt;id();