Book travel from Barcelona to Cordoba at the Rail Europe Web site (see Resources below) or call (877) 257-2887.
Understand that your train travel from Barcelona to Cordoba is a two-step journey with a connection at the Madrid Atocha train station.
Save money by choosing Economy or Comfort class. You may not get a sleeping berth for the 7 to 8 hour journey, but you'll have a comfortable seat that reclines so you can still get some sleep.
Consider upgrading to a couchette accommodation if you'd prefer not to sleep in a reclining chair. There will be two numbers on your ticket. The first number indicates the compartment and the second is your berth number.
Check into discounts for seniors and children.