Rail
For the most part, the best way (and sometimes the only way) to buy train tickets is via the rail company’s website.
If you’re travelling to a foreign land and don’t know what rail travel options there are, you’ll find pretty comprehensive lists on The Man in Seat Sixty-One. One other very useful site is Rail Dude.