Lets start with the ocean -
The ocean is blue because the water absorbs the colors in the red end of the light spectrum. Since everything else is absorbed all we see is blue.
*The ocean can also appear green or red as light bounces off of floating sediment in the water.
The sky -
Blue sky is the result of rayleigh scattering. As light passes through the atmosphere, longer wave lengths pass through unaffected. Shorter wave lengths are absorbed by gas molecules and the light is radiated in all directions. Since this rayleigh scattering is happening all over the sky, what you see is a blue sky.