How to avoid the specific page while searching in WordPress without plugin?

What you want to do is use the pre_get_posts action to exclude the post ID from the search results query. This allows you to “pre” set some elements of the query, including an array of post IDs to exclude with the “post__not_in” value.

Suppose the ID of your privacy policy it 11, then you’d pass 11 in the post__not_in array along with any other IDs you are excluding.

add_action( 'pre_get_posts', 'my_search_exclude' );
function my_search_exclude( $query ) {
  if ( ! $query->is_admin && $query->is_search && $query->is_main_query() ) {
    $query->set( 'post_type', array( 'post', 'page', 'product' ) );
    $query->set( 'post__not_in', array( 11 ) );
  }
}