www.zssk.sk/en/ is the official website to buy your train tickets in Slovakia.
Trains in Slovakia are operated by Železničná spoločnosť Slovensko (ZSSK), the national railway company. The network connects major cities such as Bratislava, Košice, Žilina, and Poprad, as well as scenic regions, including routes to the High Tatras mountains. ZSSK offers a variety of train services, including InterCity trains for faster travel between cities and local trains that provide connections to smaller towns.