What prevents a star from collapsing after stellar death? When the star stops burning because heavier elements like Iron are formed in its core. Then the gas pressure stops and as you know the gas pressure helps keep a star in equilibrium because it provides pressure against the force of gravity. So Iron does not give off energy. So what stops the star from collapsing?
So when the core starts becoming dense due to gravity it stops becoming dense due to Pauli's Exclusion principle. Fermions (a class of particle including Protons, Neutrons and electrons) of the same type obey the Pauli exclusion principle . In layman's terms, it says that such particles cannot occupy the same, small volume of space.
Thus, if you try to force them into a small volume of space, they "push back". This "pushing" creates a pressure called "degeneracy pressure", and is what keeps white dwarfs from collapsing into black holes.
So does that mean that the same fermions like electrons cant occupy the same sub shell? Does having the same quantum state mean that the fermions cant be at the same sub-energy level. Define in laymans terms quantum state? How is it different from sub shell?
Also I read that the star does not collapse into a black hole due to quantum mechanical effects. So is the degeneracy pressure the so called quantum mechanical effect?
 A: Your first paragraph is not quite right. Gas pressure does not "stop" upon formation of an iron core, it is merely that the star cannot generate further heat from nuclear reactions and becomes unstable to collapse. i.e. The star does collapse! Perhaps what you mean is what halts the collapse (sometimes) before the star disappears inside its own event horizon and becomes a black hole? The answer is the degeneracy pressure of neutrons that are formed (endothermically) in electron capture events as the star collapses and also the repulsive (strong nuclear) force between neutrons in very dense nucleon gases with a small fraction of protons.
The analogy of filled "shells" is not too bad. In quantum mechanics we find that there are a finite number of possible quantum states per unit momentum per unit volume (often called "phase space"). In a "normal" gas, the occupation of these quantum states is governed by Maxwell-Boltzmann statistics - progressively fewer of these states are filled, according to $\exp(-E/kT)$.
In a Fermi gas at very high density or very low temperature, we reach a situation where the Pauli exclusion principle limits the occupation of these states to 2 particles per energy/momentum state (one for each spin); particles that might otherwise have occupied very low energy states are forced to occupy states of higher energy and momentum. In a "completely degenerate" gas, which is a good approximation for the electrons in a White Dwarf star or the neutrons in a Neutron star (the relevant case here), all the energy states are filled up to something termed the Fermi energy, with zero occupation at even higher energies.
Pressure is caused by particles having momentum (this is just basic kinetic theory).
The large number of fermions with non-zero (even relativistic in some cases) momentum is the reason that a degenerate gas exerts a pressure, even if its temperature is reduced to close-to-zero. In fact, once a gas of fermions approaches complete degeneracy, a change in temperature has almost no effect on its pressure.
One point I will take issue with in your question, is the statement that "such particles cannot occupy the same small volume of space". In fact, the restriction is on the occupation of phase space. In a neutron star, the neutrons are almost touching each other, with separations of $\sim 10^{-15}$ m. You can cram lots of particles into a small volume, but only at the expense of giving them large momenta. If you like, this is a 3D version of the uncertainty principle:
$$ (\Delta x \Delta p_x) (\Delta y \Delta p_y) (\Delta z \Delta p_z) = \Delta V (\Delta p)^3 \sim \hbar^3$$
This relationship tells you that particles can be packed tightly together but if they are, then they must have very different momenta. This large range of momenta is what leads to degeneracy pressure.
When it comes to halting the core-collapse of a massive star and supporting the resulting neutron star, degeneracy pressure is not the entire story. As I mentioned above, the separation between neutrons is of order $10^{-15}$ m, which is the approximate range of the strong nuclear force. This is not a coincidence. Degeneracy pressure alone is insufficient to halt the collapse or support a neutron star more massive than 0.7$M_{\odot}$ - the so called Tolman-Oppenheimer-Volkoff limit. Because the nuclear matter is highly asymmetric (many more neutrons than protons), there is an overall strong repulsive nuclear force above densities of about $3\times10^{17}$ kg/m$^3$ that is also very important in halting the collapse and supporting more massive neutron stars.
