Another way to do this is to have a large heavy float (or buoy) that rides the waves, and a vertical cable that goes down through a pulley attached to a solid anchor point in the sea bed.
As the float rises and falls, the cable runs back and forth through the pulley.
This cable runs along the sea floor and up the beach, with the end wound around a cable drum. As the float rises and falls, the drum slowly rotates backwards and forwards with enormous force.
It will require either a powerful spring, or a suspended weight (with another cable) to rotate the drum backwards on the falling side of the wave.
Anyhow, the cable drum rotates backwards and forwards fairly slowly following the profile of each wave. This is best done in deep water where there are no breaking waves, so the cable needs to be quite long.
There is then a one way clutch fitted between the drum and a shaft, so the shaft always rotates only in the direction of a pull on the cable, and rising water. A speed step up gearbox and a flywheel keep everything turning fairly constantly in one direction to drive an electrical generator at suitably high rpm.
It will work as above with only one float, cable and drum.
But larger and much more efficient systems have been built with many floats and drums, with the floats dispersed over a wide sea area, so they all go up and down out of phase.
Like the pistons in an engine, all going up and down out of phase, the one way clutch in the hub of each individual drum will create almost a constant rotary motion in the main shaft.
The torque developed can be extremely high, but at low rotational speed. A suitably robust gearbox easily solves that problem. With sufficient cable winding capacity on each drum, large tidal changes in water level can be catered for. The one way clutches constantly self adjust for changing sea conditions.