First, build a dam in the middle of the river to form a huge water storage reservoir upstream. Due to the reduction in water volume downstream, a huge gap occurs between the downstream reservoir and the upstream reservoir. When the gate is open, the water upstream has great gravitational potential energy. Under the action of gravity, it flows rapidly to the lowlands below the dam, generating enormous mechanical energy (kinetic energy). When the huge flow of water passes through the culvert, it pushes the blades of the generator's waterwheel into the culvert, causing the hydraulic turbine to rotate. (Just like a water mill) A hydraulic turbine is connected to a generator having a large number of coils, forming an artificial generator. The coil rotates and enormous electrical energy is generated by magnetoelectric induction.
To put it simply: potential energy ----- energykinetic ----- electrical energy.