Depending on your needs regarding communication (calls, texts, internet, international calls, and how often you use them) you can opt for either a mobile contract or prepaid.
You can buy a SIM card with only your passport at a kiosk or store, or online. If you plan to use mostly data, Lebara offers inexpensive plans from 14.90/month for 1GB of data. MuchoMobile also offers cheap prepaid SIM plans, especially for first-time customers. (There are no official Mucho stores, but a SIM can be purchased in convenience stores in Gare Cornavin.)
To get a mobile phone contract, you must present a residency card (which you receive from the OCPM when your visa has been approved and the card has been processed and sent). The contract can be signed for one or two years with or without the purchase of a telephone.
If you want to continue to use your foreign phone in Switzerland, make sure that the bandwidth is compatible (especially for North American phones). You can find this information with a quick Google search with the name of your phone and “European compatibility.” Many older smartphones are not compatible. Also, make sure that it is unlocked prior to coming to Switzerland, as the task can be complicated to accomplish here.