How to prevent email address from displaying on edit profile page?
You can to this using hook_form_FORM_ID_alter(), like this:

function MY_MODULE_form_user_form_alter(&amp;$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  if (in_array('role_B', \Drupal::currentUser()-&gt;getRoles())) {
    // We restrict access if the field is disabled.
    $form['account']['mail']['#access'] = FALSE;
  }
}