drupal 8 field file get url 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();