Search directions how to travel from the Palace of Versailles back to hotel getting off at Porte D'Orleans

Where do I purchase the train ticket? And do we switch to a different metro?

Thanks