So long as the player has a character at level 50 they can visit Chromie in their faction’s capital and pick one of the six older expansions to level from 10 to 50 in.
Once you hit level 10 with your new character, you’ll be able to “go back” to any previous expansion until you hit level 50 and begin the Shadowlands story.
However, this is simpler to write than to do. I bought WoW boosting service from Lfcarry. It shortened my leveling time and made the experience fun.