At KUL or SZB, stay airside—KUL is massive and best explored inside, while SZB is small and exit times vary.
The round-trip KLIA Ekspres ride is 56 minutes. With immigration and airport re-entry time, realistic city time for a 3 to 6 hour layover is 60 to 90 minutes. The Perdana Botanical Garden (free entry) is a 10-minute walk from KL Sentral and works well for a compressed visit. Nu Sentral mall is attached directly to the station if you want food and air conditioning. Skip any site requiring a ticket queue.
Petronas Towers are a 20-minute walk from KL Sentral or one stop by LRT (Ampang Park). Buy Skybridge or observation deck tickets online in advance: MYR 85 ($18) for the Skybridge at Level 41. Chinatown (Petaling Street) is 15 minutes from KL Sentral by taxi or Grab (MYR 10 to 15 / $2 to $3). Budget MYR 20 to 30 ($5 to $7) for a hawker meal in Chinatown. Allow 90 minutes each way including connection time.
Batu Caves is 45 minutes from KL Sentral by KTM Komuter train (MYR 3.50 each way). The Hindu temple complex is at the top of 272 steps and has colorful statues and a golden Lord Murugan statue at the base. Allow 2 hours at the caves. Combine with Petaling Street Chinatown for a full city-and-temple day.