Without quantum mechanics, it becomes a bit sloppy, but the general principle is easy to grasp:
The nucleus is positive, and surrounded by a number of negative electrons matching the charge of the nucleus.
Once the electrons get pulled too close to the core, they start repelling each other strongly, so there is some equillibrium distance.
Why doesn't the core/nucleus pull in the electrons one by one? Well, they fly "in vacuum", so they get ever faster when they're pulled close to the nucleus. The nuclues can't catch them either, because he has not way to store or discard the huge kinetic energy the electron has. So the whole system is stable, in rather the same way the planets and comets surround the sund.
With a bit of QM, there is the additional point that pairs of electrons fly in a formation ("orbital") that keeps them at an extra distance, and all pairs of electrons have a different formation. That makes sure the whole system stays symmetric and thus stable. Electrons are individualistic, they hate to be indistinguishable from the others. Which of course they are. ;-)