Complex sentence: Tickets must be purchased in advance via the megabus.com website or by telephone when passengers are given a reservation number which they show the driver when they board.
Split into simpler sentences: Tickets must be purchased in advance via the megabus.com website or by telephone. Upon purchase, passengers are given a reservation number which they show the driver when they board.