Code snippet that can be used to load nodes to print the node fields in drupal 8.
$nids = \Drupal::entityQuery('node')
->condition('type', $content_type, '=')
->condition('status', 1, '=')
->execute();
$nodes = \Drupal::entityTypeManager()->getStorage('node')->loadMultiple($nids);
foreach ($nodes as $key => $value) {
$title = $value->title->value;
$description = $value->body->value;
}