I'm no expert but I have researched into this.
I'll cover the advanced answer first because it's important. But you might be able to follow the jist of it and then see the more basic one after.
Part of answering the question comes to order of energy levels, and that's an advanced question, in that it's currently debated among academics. And the answers once reached, will take some time to get from academic papers into undergraduate textbooks.
And the basic question(in the sense of question with the basic answer), is given a particular ordering of energy levels as per the aufbau principle, which is the assumption your books are working with, how does one explain what you asked, the electronic configuration of scandium.
You would need to know about subshells and the aufbau principle. But follow this and get the jist and then see the basic answer that follows.
The standard answer in the books(re ordering of energy levels), is that 4s<3d and that would explain your question about the electronic configurations of neutral atoms very well. (But leaves some problems to explain the electronic configurations for ions). So your question, which is asking about the electronic configuration of neutral atoms, is easily easily addressed under that view.
Beyond that, there has been some debate. Eric Scerri has argued http://ericscerri.blogspot.com/2012/06/trouble-with-using-aufbau-to-find.html that actually for Scandium, 3d<4s (This explains the electronic configuration for ions), and he gives some explanations for how that happens, even though he thinks 3d<4s Scandium. And his explanation makes ions easier to explain. But he then has to provide some explanations (And does), to explain the electronic configuration of the neutral scandium atom. He says atoms go into 3d first but jump up to 4s because it's more stable. And he thinks this process books have of trying to predict electron configurations is thus a bit silly, because the reality of what's happening is complex.
There has though been a response to Eric Scerri, by Geoffrey Neusner. And he has stated that Neutral scandium has 4d<3s(as the standard view says). But that in Scandium *ions*, the order of energy levels of orbitals gets rearranged such that 3d<4s. See this article https://www.thinkib.net/chemistry/page/37492/the-electron-configuration-of-scandium and the paper associated with it https://tinyurl.com/2kvc96my or here
I think the ball is now in Eric Scerri's court to respond to Geoffrey Neuss's paper.
Orbitals fill up low energy first, then to higher energy. (at least I don't think that model is in dispute by Scerri or Neusner or anybody)
At a very high level (and not relevant to the energy of orbitals subject), they'd say electrons are not particles, some say they are waves, or something with properties of each. And also, at a high level see this ACS paper, https://pubs.acs.org/doi/pdf/10.1021/ed200673w they say electrons don't "occupy" orbitals, they might even be spread out. And orbitals are just visual representations mapping to some Mathematics, not direct representations showing shapes of regions of space. But for the purposes of considering electronic configurations, people are fine with the concept *as a model*, of orbitals as regions and of electrons in orbitals.
You are not asking about ions. So, you're in luck. The answer is fairly simple.
But either way. What one needs to know is. What is the order of the orbitals.
At a higher level of study, it might depend on the atom and the charge on the atom. And hopefully some people are working on that will be putting that information out there in the future.
The "standard answer" says the order of orbitals is famously as per aufbau and as is clear from the blocks in the periodic table.
Assuming orbital energy level ordering as per the Aufbau rule.
And this is even covered by Middle School Chemistry, if the material is of ludicrously high quality like this
"When the third energy level has 8 electrons, the next 2 electrons go into the fourth energy level."
"The third energy level can actually hold up to 18 electrons, so it is not really filled when it has 8 electrons in it. But when the third level contains 8 electrons, the next 2 electrons go into the fourth level. Then, believe it or not, 10 more electrons continue to fill up the rest of the third level."
And you see the electronic configurations in that format here https://ptable.com/?lang=en#Properties
At 16-19 you might learn about the Aufbau principle and order of energy levels and subshells. Shown in abbreviated form here https://sciencenotes.org/list-of-electron-configurations-of-elements/
Relevant at Undergraduate level too
The list of subshells can be determined looking at the blocks of the periodic table too. Here it is as mentioned in that article "1s, 2s, 2p, 3s, 3p, 4s, 3d, 4p, 5s, 4d, 5p, 6s, 4f, 5d, 6p, 7s, 5f, 6d, and 7p"
So you see the "third shell" is only partially complete, then the fourth fills a bit, then the third continues. Then the fourth does some more(but doesn't complete). An inner shell can have electrons added to it. And so that's where many books will put aside a simple view of just the shells, and from scandium onwards will tend to put away the format of electronic configurations of K,L,M,N like 2,8,9,2 And they'll go to showing electronic configurations as e.g. 1s2 2s2 2p6 3s2 4s1 e.t.c. And that model is in a way, simpler for elements from scandium onwards in the sense that it's clear which subshell is going to fill up next.
This question that was closed might have some information of interest as it shows there is uncertainty over this in academia.
Why do 3d orbitals have lesser energy than 4s orbitals in transition metals?