We'll be in Spain in Oct and traveling between Madrid and Barcelona (1 way) and Barcelona to Girona (2 way). Which booking service do you recommend. I preview trips on Rome2Rio, but haven't traveled in Spain. In France I just downloaded the State Rail Line App and used it directly. Does Spain have a Rail Ap?
Check Seat61 for current info:
https://www.seat61.com/train-travel-in-spain.htm
I have usually used Renfe, the Spanish rail site.
If more comfortable working in English English, Raileurope is recommended by Seat 61., or Trainline.
This is where I would begin. https://www.renfe.com/es/en.
For Madrid to Barcelona I recommend Iryo, www.iryo.eu. Renfe's trains are also good, but their website is not always easy to deal with so it's much easier to buy a ticket from Iryo. From Barcelona to Girona you can either take an AVE train or a regional train. AVEs are faster, but should be booked in advance. So it depends on how you value cost vs time vs flexibility.
For Madrid to Barcelona, Iryo, Ougio and Renfe each run express services taking about the same time and departing from / arriving at the same stations. I'd use Trainline to get an overview of what is available on your particular date. Then book either via Trainline (supplement) or with the company which you prefer.