Bari Karol Wojtyła Airport: The sensible public-transport route is the Ferrotramviaria airport train to Bari Centrale (about 17 minutes; roughly €5–6), then a Trenitalia regional train south to Fasano (about 40–55 minutes; roughly €5–7). Allow 1¼–1¾ hours including the connection. Fasano station is outside the old town, so arrange a taxi or pickup for the final 10 minutes; do not assume there will be a useful local bus waiting.
Brindisi Salento Airport: Take the airport shuttle/local bus to Brindisi railway station (about 10–15 minutes; around €1–2), then a Trenitalia regional train to Fasano (roughly 35–50 minutes; about €4–6). In real life, allow 1–1½ hours plus the taxi from Fasano station into town. This is usually simpler than paying for an airport taxi unless you are a group or heading straight to a masseria, Savelletri or Torre Canne.
Fasano railway station: Fasano is on the Bari–Brindisi–Lecce main line, with regional services from Bari, Brindisi and Lecce. It is useful for town-to-town travel but poorly placed for a car-free beach or countryside holiday: the station is outside the centre, and a taxi/pickup is the practical last leg. Budget roughly €10–15 for the short taxi ride, subject to time and availability.