Amplifying what Arno said -
If you spend some time with the timetable:
You can select a train from Milano Centrale to Geneva that makes the entire trip with no change of train. The 1223 train is an example.
Other routes change at Brig, or, if you uses a regional train in Italy, you might change at Domodossola and also at Brig.
I recall stairs at Domodossola, although it has been a few years. I had to work hard with a heavy suitcase once. Maybe that was to transfer to the Centovalli branch line to Locarno....
For clarity, I mentally separate the act of picking the trains from that act of buying the tickets.
First, I pick my route and trains. Then, I look at what country or countries I will be travelling in.
Then I cover the Swiss part.
Once you are inside Switzerland ( or beyond Domodossola in this case) you need a Swiss ticket or Swiss rail pass of some kind. The Swiss Travel Pass gives free transport on all mainline and public transport inside Switzerland. The Pass is all that you need. You just show it if asked for your ticket. No need to buy a separate ticket .(The exception - some mountain railways in the Jungfrau region, for one example, only have discounts...they are privately run "excursion services.")
Then, I figure out how to get from my starting point, such as Milano Centrale, to the Swiss border. I buy a ticket for that. generally, the Swiss rail passes have no influence on the process of getting an Italian ticket.
Arno has pointed out ways to buy tickets, etc.
Hope that helps. it is confusing when you cross borders, may not have to get off the train, but need tickets for each country. The conductors will likely have different uniforms. ;-)