As a general rule, in order to get unemployment benefits, you must be a Swiss national or with a valid residence permit, be resident in Switzerland, unemployed, able to work and have contributed to the unemployment scheme for at least 12 months before.
You can register at the Office Régional de Placement (ORP), in order to be able to find a position as soon as you got your notice (even if you have a notice period to go); you can get advice and maybe some training courses.
The registration is made in two steps:
During the first interview at the agency, your advisor:
The amount of unemployment allowance is calculated according to a reference salary called "gain assuré". Usually this one is equal to the last 6 months of salary subject to contribution. Your allowance is equal to 70% "gain assuré". You can calculate your allowance here.
For cross-border workers, there are specific agreements applied.
If you have given to your employer reasons to make you redundant, or if you resigned, you can registered at the ORP agency, as for the previous case. However you are not entitled to an allowance.