You're right LIZinPA, don't panic. This is easily possible connecting through Madrid or Cordoba and as Marika says it's too early for March tickets to be available and posted yet.
If you want to check your potential options I would recommend using the Loco2.com site for the day of the week in question but a couple months earlier to get a look at potential options that have been posted. (In my experience Loco2 does a better job at booking all the tickets you need for a multi-stage journey than the Renfe site does and is in English with fares in dollars.)
For Thursday January 10th it looks like there are 15+ reasonable options throughout the day ranging from $85 to $150 dollars. Just be careful to look at the number of stops (1 is obviously best) and the travel time (should be about 5 hours) to sure you're not looking at some weird stretch option they have put together for you. It will be obvious when you click on the travel option itself but you can see it on the fine print on the first screen. You will need to wait until the March trains are posted but this should give you at least an overview of what your options are.
Overthinking travel plans (as I do you) might also consider:
You should then check the station at which you are changing and then amount of time allowed for the 'interchange' of trains. If you have a lot of luggage or are a nervous traveler maybe you want to allow more time between trains. You can also choose to upgrade your ticket - especially the second leg to flexible or semi-flexible so you can change the time if you miss the second train for any reason for a small or no fee. You check for upgrades - class and flexibility - on the Loco2 site by clicking on the price of ticket or the pink arrow on the second screen. Once you see the in and out train schedules there is no reason you can't simply book your own tickets into and out of Madrid to get a longer layover or whatever you want.
Often first class is cheaper or only a few dollars more because... well... because Renfe - but it's not a trick feel free to choose first class or pay $5 more for it. There's not a ton of differences between the classes - free food and some slightly better seats - but you'll have an assigned seat either way which is the really important thing.
Also you don't give any details about your travel but he Atocha train station is just nearby Madrid's two great museums. You could easily book into Madrid early, put your luggage into 'left luggage' at the Atocha train shed, see the Prado or the Reina Sofia since both are east walking distance from the train station or take the metro 4 stops and see the city and then resume your journey later.
If you want more information about a train station or Spanish trains in general this guy is a great resource: https://www.seat61.com/Spain-trains.htm
Have a great trip - don't panic this will be as easy as you thought it would you just have to wait to book it,
=Tod