We just did this last week! We opted for the train. You go to the main train station in Salzburg.
Take the OBB train to Attnang-Puchheim.
Get off at Attnang-Puchheim.
Switch trains, get on the OBB train to Hallstatt.
Have cash for the ferry at Hallstatt (I believe it's 3-4 euro's per person?)
Ride the ferry over to Hallstatt
I highly recommend the website "Bigboytravel.com." They go over how to get to Hallstatt via bus or train in great detail and even have videos showing you step by step how to do it. If you elect to go via train, you should buy your return OBB ticket from Hallstatt to Attnang-Puchheim ahead of time just in case the ticket office is down at the small station in Hallstatt.https://www.bigboytravel.com/europe/austria/hallstatt/gettingtohallstatt/
If you are just going for the day though it looks like the better strategy is to be up early and go by bus because it sets you up to go straight to the Five Fingers Overlook and beat the crowds.
We elected to do a one night stay there and we are glad we did. The place is overrun by tourists. They flood off the boat every hour and just pack the town. We were able to be up early the next morning and be on the first run up the funicular out to the viewing platform at the salt mine before the views just got completely packed and you had to wait in line to get a good picture at the tip of the platform. Let me know if you have more questions, I'm happy to help.