If you are EU you can enter the country freely, a few days before you go down to the local offices to register your presence. There, you will be asked to show proof of your residence and a work contract. They do an initial check and send those documents to the immigration authorities, who check whether it is likely that you will be able to support yourself (at quite a low level) on the salary you'd be earning.
If yes, and if the contract is for up to one year, you'll be given an L permit for as long as the job lasts; if it is for over one year, a 5-year B-permit . This permit application does not go through your employer. If you are non-EU you cannot apply for a permit yourself. Your potential employer must do this, and do so while you are outside of the country. Once the permit has been approved, you will receive a letter to say so, but not yet the permit .
If your country's citizens need a visa to enter Switzerland, you can submit that letter of approval to the Swiss consulate responsible for your country, and will be given a D-visa for the purposes of entering the country. If your citizenship is such that you don't need a visa, you can enter Switzerland freely.
Once you're here, you can start looking for accommodation (from whatever temporary accommodation you've arranged before you got here) and you go to the immigration offices with all the documents and will be issued with the permit. They will usually grant only an annual L-Permit , regardless of the duration of the contract. This is renewable. It is usually tied to your employer, so non-EU immigrants cannot freely move around to another employer, and they also must live in the same canton as their employer's offices. An exception is university professors, who are typically granted a 5-year B-Permit or even a C-Permit , right from the start.