While you can go to the train station itself to purchase tickets from either an automated machine or from a window booth, it is often easier to purchase them online from a booking service such as Omio. In addition, purchase tickets in advance (usually up to 3 months) and pay a lower fare as opposed to a same-day departure.