Notice: Undefined index: main_profile in include() (line 54
Your mistakes is here main_profile , profile type always start with profile_name . just need change main_profile to profile_main

global $user;  
$user-&gt;uid ;
print_r($user-&gt;uid);
print "print out the user value" . $user-&gt;uid;

$uid =3;

$account = user_load($user-&gt;uid); 
$profile = profile2_load_by_user($account);


$print_first_name =  drupal_render(field_view_field('profile2',$profile['profile_main'], 'field_first_name'));
print $print_first_name;


If you want see all your profile type and correct name and it's contents print_r or var_dump $profile

$profile = profile2_load_by_user($account);
print_r($profile);