Add class or ID to any WordPress function

If you have only one template it’s fine to do something like:

echo '<p class="whatever">' . get_the_excerpt() . '</p>';

However, if you have multiple templates and want to control the classes centrally, you can make a filter on get_the_excerpt as follows (but yeah, that would be in functions.php):

add_filter ('get_the_excerpt','wpse240352_filter_excerpt');

function wpse240352_filter_excerpt ($post_excerpt) { 
  $post_excerpt="<p class="whatever">" . $post_excerpt . '</p>';
  return $post_excerpt;
  }  

You would then simply have echo get_the_excerpt(); in your template files.