At level 40, my first stop would be Mists of Pandaria for some quick gear upgrades. (When Dragonflight came out, they redid the ilvl curve for gear but characters with older gear didn’t get the ilvl bump.)
There are several vendors in Pandaria that sell gear that will be a pretty solid upgrade for you for gold (ilvl 84 if I’m remembering correctly.) If you take the portal to Pandaria from the portal room in Stormwind (up at the top of the mage tower) the closest of these vendors will be in Singegruff.
Chromie Time (officially Timewalking Campaigns) was added in Shadowlands which will allow you to level to 60 in any expansion. In order to unlock access to it, you need to have a level 60 on your account. However, in many cases, people with max level characters from previous expansions have found that they have access to it. I’ve also been told you can make a trial character to meet the level 60 requirement.
Chromie is near the Embassy, which in Stormwind is strait out the back gate of the Dwarven District to the pond area. She’ll be marked with an hourglass icon on your map. No matter which timeline you choose, picking any of them will cause all old expansion content to scale to 60. Which one you actually choose just affects which breadcrumb quest she gives you and which dungeons you see in the group finder.
Without Chromie Time, only Battle for Azeroth and Shadowlands will scale to 60.
It looks like you last played your character in Warlords, so assuming you’ve done most of the expansion content before that, your options to get to 60 will be Legion (with Chromie Time), BfA, or Shadowlands. My personal choice would be Legion, but you may want to look and see if there are things you want to unlock from a particular expansion. For example, the various allied race unlocks require content in either Legion or BfA. So, if any of those interest you, you might as well get some of the work done while leveling.
To start Legion, select that timeline from Chromie.
To start BfA, pick up the quest Tides of War from the Herald NPC standing next to the Hero’s Call board.
To start Shadowlands, the easiest option is Chromie again as getting the right phasing for the starter quest otherwise can be a pain.