For the sake of ease, I'll use some metaphors....
The letter refers to the shape of the orbital--spherical-shaped, doughnut-shaped, figure eights, etc.
and the prefix number is the "level" such as 1s = first (smallest) sphere, 2s would be the next larger sphere.
...and then the following number (following the letter) is how many electrons are filling that orbital (each shape having a unique maximum number of electrons--s=2; p=6; d=10; f=14; ...if i recall).
Anyway... the lowest energy level (#1) is so small it can't accomodate p-shaped orbitals; but at the "2" level, it is "large" enough to accomodate those p orbitals. And so on...
[There's no 2d orbitals are there? But the 3 shell is large enough to hold "d" orbitals along with the s and p orbitals.]
Also, within the "size range" of each energy level, the s orbitals are the smallest, the p orbitals are the next smallest (medium sized), and the "d" orbitals are the largest (except for the more rare, very large, "f" orbitals).
So you should be picturing each "energy level" or "shell" as able to contain orbitals--with the higher (larger) levels or shells able to contain 2, 3, or even 4 different shaped orbitals.
...aside: These orbiting electrons all more-or-less overlap in space, but are essentially invisible to each other; they don't "bump into" each other, but they can "sense" if lower energy levels (or smaller orbitals within their own level) are filled with other electrons.
===
But when you get up to the higher levels (say level 3), where they are fitting in p and d shaped orbits, some of those orbitals are "larger" than the next higher (level 4) s orbital (s orbitals being the smallest for each level).
...Or if you envision a stack of shelves--representing the 1, 2, 3, 4, etc., energy level (shells)
...and junk on the shelves as representing the different orbitals, the "s" orbitals on each shelf are little things, while the p and d orbitals sometimes reach up to the bottom of the next higher shelf.
...or sometime an orbital will "stick up" higher than the next shelf up and even be higher than the low stuff (s orbital) on that next shelf up.
This is the analogy for a 3d orbital being "higher" than a 4s orbital.
"Higher" representing "higher energy" and so the 4s orbital is technically lower energy than the 3d orbital, even though we think of the 4 shell as "higher" than the 3 shell.
Sometimes also, since the orbitals prefer to have certain patterns of filling with electrons, it might be more stable for
all the orbitals if one or two orbitals are forced into a less stable pattern.
So while usually an orbital will be more stable with 2 electrons filling it, sometime an electron will be "scavenged" from a stable, filled orbital to achieve a more stable pattern overall.
Thus:
3s2; 3p4 ...would be followed by
3s1; 3p6 ...instead of the expected
3s2; 3p5 ...because the p6 pattern is so much
more stable--than the slight instability of the s1 pattern.
===
...OR
3p3; 4s0 ...might be followed by
3p3; 4s1 ...instead of the expected
3p4; 4s0 ...because the p4 is more unstable than the p3 pattern; and the slight instability of an s1 pattern (over an empty--of neutral stability--orbital) does not overide the stability of the p3 pattern.
===
...OR just with the p orbitals
oooops, no; I don't want to get into the px, py and pz filling orders (2 electrons each, for a total of p6)
It's been 30 years since I studied this stuff, so forgive any gaps or errors; but I think the overall logic should be correct (as an analogy or metaphor) in explaining why the electrons don't quite fill up the orbitals in a easily predictable way.
It is the easiest way for the electrons to fill the orbitals, but our models just don't quite capture the nuances.
===
...hmmmmm. Well I'm glad I tried the easy way....
===
...hope this isn't more confusing than before, but if not....
If you have any specific questions, I'll give those a go too.
~