The use of colour in most movies is not random. It’s actually all thought through and planned far in advance of shooting, in order to amplify and help convey the emotion and story. This excellent video walks you through the complicated theory of colour and how it’s used in the film industry.
One popular way to simplify how colour is designed is to use the 60/30/10 rule, as this video from Wolfcrow describes. It’s different from colour grading which is colour adjustment applied in post-production.