get url from file field drupal 8 code example
Example: drupal 8 get file url from target id
use Drupal\media\Entity\Media;
use Drupal\file\Entity\File;
$media = Media::load($mid);
$fid = $media->field_media_image->target_id;
$file = File::load($fid);
$url = $file->url();