Verify a node with a given node ID exists
If you don't want to load the entire node then you can use entity query:

$values = \Drupal::entityQuery('node')-&gt;condition('nid', $id)-&gt;execute();
$node_exists = !empty($values);


This will be much more efficient because it only asks for the ids and not all the node fields.