Counting the suburbs there are four train stations: Zagyvapálfalva, Salgótarján külsÅ, Salgótarján the main station, and SomoskÅújfalu. For most tourist purposes the main station is the only one that stops downtown and the only one that matters. The SomoskÅújfalu station can be used to reach the castle ruins, but even then it's simply easier to take a bus from downtown.
The intercity bus station is also downtown, opposite the main train station. Nográd Volán (http://www.nogradvolan.hu/) provides local bus services throughout the town. Unless you have a whole day of hiking planned, this is the only way to get to the castle ruins. Bus #11A goes to the castle in SomoskŠand bus #11B to the ruins to in Salgóbánya. Both of these buses only run once an hour. If you want to visit both castles it gets tricky as you'll have to visit one, then backtrack to Ifjúság u. where you can catch the other bus.
Taxis are another option and you have to call in advance.
The downtown is incredibly compact and easy enough to get around by foot.