Get user role by user field how can I access to my user role thanks to my user custom field ?

I have an user field called "custField" and it's value (example : 123456). I need to check all users that have "123456" as value. 

Then, I need to check if this user as the role "director". 

But I don't know how to access role thanks to another field. 

EDIT : 

See this loop : 

foreach($retraitDoublons as $valUnique){
  $users = \Drupal::entityTypeManager()-&gt;getStorage('user')
    -&gt;loadByProperties(['field_custVal' =&gt; $valUnique]);
  $user = reset($users);
  $user_has_role = $user &amp;&amp; $user-&gt;hasRole('directeur_cr_');

  dump($user);
  dump($user_has_role);

  echo $valUnique . "&lt;hr&gt;";
}
Similar to this question:

I have an user field called "custField" and it's value (example : 123456). I need to check all users that have "123456" as value:

$users = \Drupal::entityTypeManager()-&gt;getStorage('user')
  -&gt;loadByProperties(['field_custField' =&gt; '123456']);


Then, I need to check if this user:

$user = reset($users);


has the role "director":

$user_has_role = $user &amp;&amp; $user-&gt;hasRole('director');