Create global array to compare inside a query

First you need to loop trough the posts, get all the 10 posts, based on their sales number.

Then, you need to check if the current product ID is equal to any ID of the products you looped.

If it is, then you show ‘best seller’ tag for the product.

In your code, you are probably mixing stuff.

Your code should be something like this:

$post_type_query = new WP_Query( 
array(
    'post_type'           => 'product',
    'post_status'         => 'publish',
    'ignore_sticky_posts' => 1,
    'posts_per_page'      => '10',
    'meta_key'            => 'total_sales',
    'orderby'             => 'meta_value_num', 
)
);
$products_ID = array();
while ($post_type_query->have_posts()){
    $post_type_query->the_post();  
    $products_ID[] = get_the_ID();
}
wp_reset_query();
return $products_ID;
$id = get_the_ID();
if (in_array($id, $products_ID)) {
    echo "Best Seller";
}