OK. Electrons. Where do they get the energy to stay in orbit around the nucleus?
There are two answers to this. One is classical (Newtonian) mechanics, the other quantum mechanical. The classical answer is incorrect, but reveals what might be a bit of misunderstanding implicit in the question. The quantum mechanical answer is weird, and hard to understand and put in just text, because it is quantum mechanics.
So, I'll take a stab at both.
Classical:
Well, where does the Earth get the energy to stay in orbit around the Sun? Or the Moon around the Earth?
In classical mechanics, once you have a stable orbit, you don't need to continue to add energy to stay there. The orbiting object is pulled towards the center, but is moving fast enough sideways that it always misses the thing at the center. So long as nothing acts to slow down or speed up the sideways motion, it just keeps falling toward the center and missing. Very Douglas Adams - throwing itself at the ground and missing is the essence of being in orbit.
Quantum mechanics:
It isn't appropriate to think of the electron as a particle in an orbit. On the scale of an atom, the electron is a wave. Just for an idea, you can sort of think of it as a wave running in a circle around the nucleus, and it can be stable at distances that make the orbit an even number of wavelengths of the wave. This need to be an even number of wavelengths means that the electron can only sit at specific distances from the nucleus, so there are "energy levels" it can sit at. In order to become part of the atom, the electron sheds any excess energy, and then can just sit in a particular energy level.
In reality, we don't think of its position in its orbit, so much as the probability of finding the electron at a particular point near the nucleus. The electron is sort of smeared out in a cloud (sometimes called the "electron cloud") around the nucleus, until we directly observe whether it was at a given place. The equation to calculate the probability distribution is a differential equation, so it requires some calculus to get it right, but it falls out that the "orbitals" that result have some interesting shapes - they aren't just circles. These shapes give rise to the shapes of molecules.
https://en.wikipedia.org/wiki/Atomic_orbital#Orbitals_table