Print image URL with image style
Change the display mode of your field with the image style you want. And it's ok

But If you want do this with a custom module, you can do this:


$imageFile = Media::load($media_mid);
$style = \Drupal::entityTypeManager()->getStorage('image_style')->load('thumbnail');
$imageThumbnailUri = $style->buildUrl($imageFile->get('thumbnail')->entity->getFileUri());