Theory:

Energy from the sea:
 
Tidal energy:
 
The level of water in the sea rises and falls due to the moon's gravitational pull on the spinning earth. Try to observe how the sea-level changes during the day if you live near the sea or travel to a place near the sea. High and low tides are the result of this phenomenon, and the difference in sea levels provides us with tidal energy. The construction of a dam across a narrow opening to the sea is used to harness the source of tidal energy. Tidal energy is converted to electricity by a turbine located at the dam's opening. As you might expect, the number of places where such dams can be built is limited.
 
Tidal_energy_generator,_Eday_-_geograph.org.uk_-_1267433.jpg
Tidal energy
 
Wave energy:
 
Similarly, huge waves near the seashore can have their kinetic energy trapped in a similar way to generate electricity. Strong winds blowing across the sea cause the waves to form. Only where there are very strong waves would wave energy be a viable option. A variety of devices have been developed to capture wave energy for turbine rotation and electricity production.
 
wave-1321029_960_720.jpg
Wave energy
Reference:
https://commons.wikimedia.org/wiki/File:Tidal_energy_generator,_Eday_-_geograph.org.uk_-_1267433.jpg
https://pixabay.com/photos/wave-smashing-foam-spray-energy-1321029/