The swinging pendulum swings through the mutual transformation of gravitational potential energy and kinetic energy. Simply put, if you pull up the pendulum, it will fall down because of the influence of gravity. When it reaches the lowest position, it has a speed, so it can't stop there directly (just as the brakes can't stop at once), and it will continue to cross the lowest position. When it swings to the highest position, it will swing back because gravity slows it down to 0, and then swing back again (just like throwing something into the sky, it will rise). Just go back and forth and keep swinging.