how the potnsial energy of the electrons related to the attraction of electrons
Electrons have potential energy because of their negative charge. This charge is attracted to the positively charged nucleus, keeping the electron in orbit around the nucleus. For an analogy, consider the Earth and the sun. The Earth remains in orbit because it is attracted to the sun by gravity. If the sun's gravity were to spontaneously vanish, the Earth would fly out into space, releasing all of the stored energy from its momentum. In this way an electron is like the Earth. Its attraction to the nucleus stores potential energy from its momentum.