To know the answer to this question, you must first understand that sunlight is made up of different colours, from red, orange, and yellow, to green, and blue.
When sunlight falls on the sea, it is the colour blue that is reflected by the water most easily, giving the sea its blue colour. Near the coast, sea water takes on a yellow or brownish tinge. This is due to the mud that rivers discharge into the sea, and the vast number of tiny plants and animals near the surface.
When clouds hide the sun, the sea will look grey. Weather conditions can also change the colour of the sea.