You can either buy the day of at the station, book them on the Korail website, or finally, through the Korail app. However, if you wait to buy a ticket on the day of your trip, it is likely that tickets will be sold out, so it's always best to book in advance.