user_role_revoke_permissions() for administrator
Here is the snippet code works for @Saba original author of the post in case someone needs it.



function YourModuleName_eu_cookie_compliance_show_popup_alter(&$show_popup) {
  $current_user = \Drupal::currentUser();
  $roles = $current_user->getRoles();
  if (in_array('administrator', $roles)) {
    $show_popup = FALSE;
  }
}