Dear Student
The energy can be harnessed from ocean in the following ways:
(i) Tidal energy Due to the gravitational pullmainly of the moon on the spinning of the earth, the level of water in the sea rises and falls,are called high and low tides that can be harnessed by constructing a dam across a narrow opening to the sea.
(ii) Ocean thermal energy The water at the surface of the sea or ocean is heated by the sun while the water in deeper sections is relatively cold. This difference in temperature is exploited to obtain energy in ocean thermal energy conversion plants.
(iii)Ocean Wave Power, in incresing wave power,the back and forth or up and down movement of waves are captured for example to force air in and out of a chamber to drive a piston or spin a turbine that can generate the power
Hope this helps you