Sarlat is not easy to reach without a car, which is worth knowing before planning a visit. The nearest airports with useful connections are Bergerac (70 km west, Ryanair routes from several UK and European cities) and Bordeaux (175 km west, with national and international flights).
By train, the closest main-line station is Périgueux (70 km north), with connections to Paris Montparnasse (under 3 hours). A regional service links Périgueux to Sarlat, but it runs only a few times daily and the journey takes about 90 minutes. From the other direction, Les Eyzies station (on the Bordeaux–Sarlat line) is 20 km away.
The SNCF bus service from Sarlat station runs to Périgueux and to Souillac (rail connection to Paris via Brive). If arriving by train from Paris, Brive-la-Gaillarde (50 km east) has better connections and regular taxi or bus links to Sarlat.
For exploring the châteaux and caves of the surrounding area, a car is essentially mandatory.