A very easy but pricy option is the Swiss Travel Pass, which includes all regular trains, busses, trams, boats and some funiculars as well as the entry to musems. For up to 15 days, this costs 459.- per person. Alternatively, you can buy seperate tickets for each journey (which is somewhat hard to do because not all stations have ticket machines) or use the apps ‘Fairtiq’ or SBB Mobile EasyRide. These allows you to simply activate it before boarding the train and desactivate it after reaching the destination. If you use Fairtiq, you can travel with more than one person; with EasyRide that is not possible.
If you want to buy single tickets, you need to buy them for each journey which you can do either online or in the SBB Mobile app.You can register multiple people into the same app, but note that you might have to provide identity documents as online-bought tickets are personalized.
For allmost all cases all kinds of tickets are equally valid and also equally expensive. It is easiest to either use a Swiss Travel Pass or EasyRide/Fairtiq because the ticket system can be somewhat complicated at times.