How to get a media image value from node in drupal 10

Include the Node class

use Drupal\node\NodeInterface;

$node = Drupal::routeMatch()->getParameter('node');

if (!$node instanceof NodeInterface) { 

  return; 

}

$image = $node->get('field_image')->entity->field_media_image->entity->getFileUri();

Category