Need to hide a field for the node author
You are referencing $user without bringing it into scope.

e.g using your current approach you could do this:

function aapka_preprocess_node(&amp;$variables){
  // Bring global user object into scope
  global $user;
  // Assign by reference
  $node =&amp; $variables['node'];
  if ($node-&gt;type == 'education'){
    if ($node-&gt;uid == $user-&gt;uid &amp;&amp; $user-&gt;uid != 1) {
      unset($variables['content']['field_college']);
    }
  }
}


Keep in mind that won't work if the node is cached and the cache doesn't vary between the author and other regular registered users.