This function was deprecated in Drupal 9. 

Error: Call to undefined function entity_get_display()

Solution

Instead, use:

$display = \Drupal::service('entity_display.repository')->getViewDisplay($entityType, $node->getType(), $viewmode);