Theory:

The Sun heats the water at the sea's or ocean's surface, but the water in deeper sections is relatively cold. This temperature difference is used to generate energy in ocean-thermal-energy conversion plants. If the temperature difference between the water at the surface and water at depths up to 2 km is \(20\) \(K\) (\(20°C\)) or more, these plants can operate. A volatile liquid like ammonia is boiled in warm surface water. The liquid vapours are then used to power the generator's turbine. The cold water is pumped up from the ocean's depths, where it condenses the vapour into liquid again.
 
The sea's energy potential (tidal energy, wave energy, and ocean thermal energy) is substantial, but commercialisation is difficult.
 
sea-2252564_960_720.jpg
Ocean thermal energy
 
Ocean thermal energy conversion (OTEC) is a process or technology that uses temperature differences (thermal gradients) between ocean surface waters and deep ocean waters to generate energy. The sun's energy heats the ocean's surface water.
Reference:
https://pixabay.com/photos/sea-wave-energy-beach-ocean-2252564/