If you want to move out you must generally give notice to the landlord although there are exceptions. Landlords too are required in most cases to give you notice if they want you move out. In some cases a landlord could require you to leave immediately.
If you want to move out you need to give the landlord notice. How much notice is required depends on the situation. If you have signed a lease there are only limited circumstances when you can end the lease.
Landlords can give their tenants notice to move out. Landlords must have one of the reasons set out under the law to ask a tenant to move out.
Landlords and tenants both have responsibilities and obligations regarding the return of a security deposit.