The reason why you have those three tickets is that ticketing works different in Italy then in Switzerland.
In Switzerland tickets are for a route. For a trip in Switzerland there will always be just one ticket, even if the trip involves multiple trains, buses, trams, cable cars etc…
In Italy tickets are for a particular train.
So in order to accommodate this difference the booking system splits your journey in two, and sells you tickets according to the Italian system till the border, and a ticket according to the Swiss system from there onwards. That is why the tickets appear so different, and that is why the tickets are split in Chiasso, which is the border station.
You just take the trains mentioned on your schedule, and you will be fine. When the conductor comes to check tickets you show the first one when on the train to Milano, the second one when on the train to Switzerland, and the third one once you are in Switzerland. The train Milano - Mendrisio (which actually goes to Locarno) does stop in Chiasso, but you can just stay on board.
Have a look at a map an you will understand. For example here: https://www.tilo.ch/dam/jcr:34826528-555a-4da7-8e33-764c01b13e99/Piano%20validit%C3%A0%20tariffa%20transfrontaliera%202022.pdf
From Milano you will be on the RE80 line, and in Mendrisio you wiull change to an S90, S10 or S50. Confusingly your schedule shows train numbers, not line numbers. You will not see those in Switzerland. Just look for the RE to Locarno in Milano and you will be on the right train.