Given $node
, this is how you get the edit form.
$form = \Drupal::entityTypeManager()->getFormObject('node', 'default')->setEntity($node);
$node_form = \Drupal::formBuilder()->getForm($form); // render array
Note: use dependency injection whenever possible.