modules/custom/d_p_subscribe_file/src/Controller/DownloadFile.php
private function getSubscribeFileEntity($field_name, $field_value) {
    $subscribe_file_entity = \Drupal::entityTypeManager()
      ->getStorage('SubscribeFileEntity')
      ->loadByProperties([$field_name => $field_value]);
    if (empty($subscribe_file_entity)) {
      throw new NotFoundHttpException();
    }
    return reset($subscribe_file_entity);
  }
private function getSubscribeFileEntity($field_name, $field_value) {
    $subscribe_file_entity = \Drupal::entityTypeManager()
      ->getStorage('SubscribeFileEntity')
      ->loadByProperties([$field_name => $field_value]);
    if (empty($subscribe_file_entity)) {
      throw new NotFoundHttpException();
    }
    return reset($subscribe_file_entity);
  }
Get SubscribeFileEntity
@param $field_name
@param $field_value
@return \Drupal\Core\Entity\EntityInterface|mixed