Duplicate, Google chose different canonical than user

I have encountered an issue with duplicate pages in google search console. I’m using the minimal theme and I cannot find the location in the code I need to change to resolve this issue. Has anyone using the minimal theme run across this issue and if so how did you resolve it?

Basically there are duplicate pages like this

https://www.webpage.com/collections/collection

https://www.webpage.com/collections/collection-1

The -1 gets added when going to the same product page through products instead of collections.

In another post they mention removing the within: collection from the code

product.url | within: collection

but this code doesn’t reside in the minimal theme anymore. Any help would be greatly appreciated. Thanks!

Yes, of course. https://www.theplantpotstand.com/

I did read a bit on using the canonical tags which made sense and appeared to be straightforward to implement however putting that into the liquid code isn’t as straight forward as I thought it would be. Thank you for your quick and helpful response. I’ll give canonical tags another try. I was hoping the other option was still available.