Try this code it will surely work, before testing this code make sure you have added the categories title as numbers.
$terms = get_terms( array(
'taxonomy' => 'list',
'hide_empty' => false
));
$user = wp_get_current_user();
if(!empty($terms)){
foreach ( $terms as $term ) {
if($term->name == $user->ID){
// Do something
}
}
}
This code will works only for post which id you gave.
$args = array('orderby' => 'name', 'order' => 'ASC', 'fields' => 'all');
// You need to add Current Post ID here.
$get_terms = wp_get_post_terms($post_id,'list',$args);
//Get Current User Info
$user = wp_get_current_user();
//Check array is not empty
if(!empty($get_terms)){
foreach ( $get_terms as $term ) {
if($term->name == $user->ID){
// Do something
}
}
}