There is a long, recent thread on buying tickets ahead of time.
https://community.ricksteves.com/travel-forum/italy/buying-train-tickets-on-day-of-arrival
The bottom line is you can't predict whether your flight will be on time, how long luggage and immigration make take so buying ahead of time means you might miss your train unless you buy one much later in the day and then end up waiting. Between the two companies there are so many trains just wait until you're ready and buy the next one.
Yes you can use your credit card but by far the easiest way is to use the app. You can preload it with your information on the website account and then buying tickets takes a minute or two.
There are two train companies in Italy - the state run Trenitalia and the private run .Italo that only runs fast trains between big cities.
https://www.trenitalia.com/en.html (Use Italian names for cities - Firenze for Florence and Roma for Rome - for best results)
https://www.italotreno.com/en
Fast trains have reserved seating, multiple classes and you can buy tickets ahead of time at a (sometimes significant) discount trading flexibility for price.
Local regionale trains - like Siena - have one price that never changes and can't sell out so there's no reason to buy them until you need them.
Both companies have apps that let you buy and store tickets as well check trains in motion. I recommend getting at least the Trenitalia one if not both.
A great resource for train travel in general is here: https://www.seat61.com/train-travel-in-italy.htm
Have a great trip,
=Tod