How to do something when user profile rendereing?

I’m not sure I understand your question correctly, but I give it a try…

<?php function remove_xprofile_links() {  
    global $current_user;
    get_currentuserinfo();
    $user_id = $current_user->ID;
    $field = xprofile_get_field_data(3, $user_id);

    $class="normal-profile";
    if ($field == '{whatever}') {
        $class="hidden-profile";
    }

    $html="<div class="" .$class . '">' . $field . '</div>';
    echo $html;
   ?>

And in css you should have

.hidden-profile {display:none;}