You do not always want to render a full output or your entity. This useful snippet teaches you how to render a single field value output.

$render_array = $contest->field_winner_page_content->view('default'); // 'default' is my view mode. You can use 'teaser', 'full', ...
$output = \Drupal::service('renderer')->renderRoot($render_array);

This uses the renderRoot() function in drupal: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21Renderer.php/function/Renderer%3A%3ArenderRoot/8.2.x


Saved you some valuable time?

Donate and get more free time-saving code on this website in the future.