I am landing at Edinburgh airport and want to take a train to St Andrews. what is the best option for first class travel?
I did this trip from the center of Edinburgh about a year ago. If someone with more local knowledge comes along with improvements, that would be appreciated.
You'll need to get from the airport to the train station, either Edinburgh Waverly (the main train station) or Edinburgh Haymarket (slightly closer to the airport). You can do this with the Airlink 100 bus service, for which combined bus+rail tickets are available from a vending machine in the domestic arrivals area. Or you can take a tram. A more luxurious option, and one more convenient with luggage, would be a car service or a taxi.
From the train station, you can take the East Coast Main Line to Leuchars station, located near St. Andrews. Rail service to St. Andrews was discontinued in 1969, which apparently continues to be a sore subject, but Leuchars station is nearby. Train schedule and ticket information are available from ScotRail; the journey takes about an hour. First class service appears to be available only on some trains, so you'd need to plan accordingly if that's a requirement. The train should be pretty comfortable either way, but booking a seat reservation is recommended if you want to be guaranteed a place to sit. If you'll be taking the bus from Leuchars to St Andrews, consider a RailBus ticket by buying your ticket to "St Andrews Bus."
When you get to Leuchars, you can take a bus or taxi into St. Andrews, or ask your accommodation about a transfer if you're staying in town. It's roughly 5-6 miles. I had no trouble getting a taxi at the train station when I did it, and there's a taxi rank in town for the reverse trip, but you can keep a list of taxi company phone numbers at hand in case you need to call for one.
Note that there are also shuttle services that will drive you to St. Andrews directly from the airport. Several options are listed here.