How can I get Google to only index main product pages?

Hello,
I have a problem related to indexing my product pages. I used canonical tags for the main product pages, since one product page can appear in different pages, on collection, and on a “You may also like” section. that’s why I thought using canonical tags would solve the issue. But I found out that Google is indexing each variant on its own.
Please advise on how can I ask Google to only index the main product page and remove the other variants from the index.
Thank you.

Really important question, Now a days google more advance for this issue, You submit the URL of your main product page to (Google Search consul URL Inspection Tool) then click request index, it’s take 24 hour , another you can do sitemap update , if URL Inspection Tool not working, But I’m sure about this Google URL Inspection Tool is working 100%

Best Regrads
Yusuf

Thank you for you response Yusuf,
I always submit the sitemap when I make big changes to the website, but I notice that variants are still getting indexed with the main product pages. The last thing I added on the theme.liquid file was the canonical tag for each main product page :
inside

then the issue happened, each variant is indexed on its own, and the main page isn't considered as canonical

Could you share your main product page link

Same problem I’m facing, last time i connect Shopify chat support and i got no solution for this. Really worried and it’s disturbing me.

Submit your product page to Google Search console. Go to URL inspection tool and submit, another update your sitemap