Esslingen is directly connected to Stuttgart by trains that ride quite frequently. Either a line S1 that rides between Kirchheinm and Herrenberg or Regionalbahn lines R1 and R8 provide fast and comfortable transport.
Esslingen is about 15 minutes away from Stuttgart by train or S-Bahn. Although it is a suburb of Stuttgart, it is outside the central 10 and 20 zones, so be careful that your ticket covers it. If you buy the full three day StuttCart that covers all of the city, you will be able to travel here. Alternatively you can take the train, which is marginally faster, either as a direct journey, or by stopping off here en route to another town, like Tubingen. This is what I did when visiting. German train tickets allow you to break the journey wherever you like for 24 hours on short journeys of less than 100km, and three days on longer ones.