This is easy. Pump the water uphill. Then generate electricity as it flows back down. Perpetual energy!
Actually pumping water uphill is done.
Coal fired and nuclear power plants do not shut down and run 24/7. So, hydro dams produce water to be used during peak times. Peak rates are charged, during off peak when rates are lower, power generated but not sold to customers is used to pump the water back uphill. There is no perpetual energy just a use of excess capacity.