First of all create some products and assign them to categories. I’ve created two products, two categories and assigned one product to each category.
This will be my shop page look like after products creation and assignation with the category.

Now, let’s say I want to remove one category i.e. Accessories from shop page.
You’ll see the defined category has been removed in shop page.

You will need to put this code in your theme’s functions.php file of your active child theme (or theme)
add_action( 'pre_get_posts', 'hide_category_from_shop' );
function hide_category_from_shop( $query ) {
if ( ! $query->is_main_query() ) return;
if ( is_admin() ) return;
// Hide on shop page
if ( is_shop() ) {
$tax_query = (array) $query->get( 'tax_query' );
$tax_query[] = array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => array( 'accessories' ), // Your category slug
'operator' => 'NOT IN',
);
$query->set( 'tax_query', $tax_query );
}
}