How do I get a list of all taxonomy terms assigned to a node (or any entity)?
One way to do it is to iterate through each field and check if it's an entity_reference field with target type taxonomy_term, then extract the data you need.

$terms = [];

foreach ($node-&gt;getFields() as $key =&gt; $field) {
  if ($field-&gt;getFieldDefinition()-&gt;getType() == 'entity_reference') {
    $targetType = $field-&gt;getFieldDefinition()
      -&gt;getItemDefinition()
      -&gt;getSetting('target_type');
    if ($targetType == 'taxonomy_term') {
      $new_terms = array_map(function (\Drupal\taxonomy\TermInterface $term) {
        return $term-&gt;label();
      }, $field-&gt;referencedEntities());
      $terms = array_merge($terms, $new_terms);
    }
  }
}


One advantage to this approach is it will work with any fieldable entity type.