Tainan High Speed Rail Station (THSR; Shalun): The useful transfer is the connected Shalun TRA station: take a local TRA train to Tainan TRA Station in the center (about 25–30 minutes, NT$37; roughly every 30 minutes, approximately 06:00–00:00). The HSR station is 10 km southeast in a mall-heavy new development, not where you want to stay. Free HSR shuttles to City Hall and Chi Mei Medical Center exist, but are only worthwhile if those are genuinely your destination. A taxi is about NT$400.
Tainan Railway Station (TRA): This is the right rail arrival for the old city: West Central temples, Chihkan Tower and the food streets are a walk or short taxi/bus ride away. Frequent TRA services connect Kaohsiung in about 1 hour (roughly NT$70–100); Taipei is 3½–6 hours depending on train class (about NT$758 on a four-hour express).
Kaohsiung International Airport: Usually the sensible international gateway. Take the Kaohsiung MRT Red Line from the airport to Kaohsiung Main Station, then a northbound TRA train to Tainan; allow roughly 1½–2 hours door to door, depending on the connection. A direct taxi/car is about 45–60 minutes but is poor value unless shared or arriving very late.
Taiwan Taoyuan International Airport: For long-haul arrivals, do not detour into central Taipei: take the Airport MRT to Taoyuan HSR Station, then HSR south to Tainan (about 1½ hours on the HSR; around NT$1,350 cited for the HSR leg). Add the airport-transfer and the Shalun-to-central-Tainan TRA connection, so budget about 2½–3 hours to your hotel.
Tainan Airport: Convenient only when its limited schedule fits: it has service to Kinmen and Penghu and limited Hong Kong flights. Bus 5 reaches town; otherwise take a short, inexpensive taxi. The terminal is on a shared military airfield, so schedules can change around exercises.