The main image of a configurable product changes with the swatch colour tiles in Magento 2. However, there are a few settings to check if this doesn’t work out of the box.
Update Product Preview Image
In the product attribute section in Stores >> Attributes >> Product >> Color, make sure “Update Product Preview Image” is set to “Yes.”
Also check the options “Visible on Catalog Pages on Storefront” and “Used in Product Listing” for the attribute (in this case color) are set to “yes”.
I’ve found that although Magento admin option labels often indicate they only apply to catalogue pages, not having them enabled also affects the product page. Magento 1 similarly had swatch colour issues, although these often related to the naming of the colour and / or image tile.