How to buy train tickets in Budapest?

The simplest way to buy train tickets is at train station ticket offices. Buying online tickets is also possible using the Hungarian train company’s website.