You can render a $node
as follows:
$view_builder = \Drupal::entityTypeManager()->getViewBuilder('node');
$view_mode = 'default';
$course_view = $view_builder->view($node, $view_mode); // render array
Note: use dependency injection whenever possible.