Chances are that if you take a picture of the beach, you'll have some of the ocean in the picture. Learning how to photograph the ocean is all about knowing what feel you want to convey with your photo.
One of the most common methods for photographing the ocean is to freeze the movement of the water. This method shows detail in the water and waves such as water droplets frozen in mid-air. Like most action photography, freezing the water requires a high shutter speed. While working with close-up water splashes can require a shutter speed of 1/4000 of a second or faster, water splashing from waves has many speeds and your distance from the waves will let you shoot with a more moderate shutter speed of 1/2000 of a second. If lighting conditions allow for the faster speed, always err on the side of a quicker shutter when trying to freeze the movement of water.
Consider a protective housing on your camera such as a rain hood; either purchase one or make your own out of a large plastic bag. This won't create a perfect line of protection for your camera, but it will greatly reduce the chances of sand/water damage.
Photos of streaks of water instead of frozen droplets help to convey the motion of the water in a still image. Use a slow shutter speed; how slow will vary based on the speed of the water, but start around 1/5 of a second and make adjustments from there. To get these very slow speeds in bright light, you'll need to use a low ISO, narrow aperture, and a neutral density filter (ND filter). You'll need a tripod, monopod, or another sturdy surface to brace your camera when shooting with low shutter speeds.
Due to the drastic light changes from foreground objects to the brighter ocean, you will often need to help your camera capture the blue of the water instead of a washed out overexposure. An easy way to do this is to use a polarizing filter. These filters help cut through the haze and tend to deepen the blue of water and sky.
If the ocean water is smooth and waveless, you can often capture reflections of piers, boats, and other objects. Extremely shallow water is also a prime area for capturing reflections. If you are using a polarizing filter to help with increasing the blue in the sky or water, you'll want to remove it when photographing reflections as this filter tends to reduce the reflective effect.
Don't limit yourself to only photographing the ocean with the sun shining on the water. Capturing waves and splashes with the sun behind the water can create stunning effects as well. Remember that with this type of shot, you'll want to plan your exposure for the darker part of the water so that the solar illumination is very bright.