How to show shopify product variants as a product or related products on the products details page ?

Some of us might have come across a requirement where we need to show the variants of a product like colors, size, etc. in terms of products or related products with carousel kind of effect and so. Recently, I got into similar kind of situation where a product was having variants like colors: red, green, […]