The Swiss authorities online
As a foreign national working in Switzerland, you do not need to immediately leave Switzerland if you lose your job or if your employment contract expires.
If you hold a valid short stay permit you may remain in Switzerland for up to six more months. This will give you time to find another job. However, you will need to obtain authorisation from the cantonal immigration or labour market authorities.
If you live in Switzerland, i.e. hold a valid Swiss residence or settlement permit (see list of questions on entries and stays in Switzerland) and meet the requirements, you will be entitled to receive unemployment benefits. Your nationality does not affect your entitlement to unemployment benefits.
If you live abroad and have a cross-border commuter permit (permit G) which allows you to work in Switzerland, you pay contributions in Switzerland. If you have to work short-time you receive compensation under the Swiss unemployment insurance scheme. If you lose your job you receive unemployment benefit in your country of residence but can benefit from the services of the public work placement scheme in Switzerland. In order to do this, contact the job centre in the region where you last worked.