How to do something when user profile rendereing?

Im new with worpress.
I have a site wp+buddypress. Now i want get a fields value in user profile and do something depend by this field value. I can get this value useing:

$class = xprofile_get_field_data( ‘Field_Name’, $user_id );

But i can’t found place where i gonna put my code.
What method i need to modify, or maybe exist hook what i can use to create separate plugin?

UPDATE Some code

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

    echo "<script>console.log( 'Debug Objects: " . $field . "' );</script>";
}
add_action( 'bp_init', 'remove_xprofile_links' );

?>

I put some code in bp-custom.php. Now i know a field value. But still dont know how to hide fields. Any advises?

Solutions Collecting From Web of "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;}