It is illegal for the landlord to lock you, the tenant, out of your rental unit overnight unless he/she has a court order to evict you. This court order is called Writ of Possession.
If your landlord has locked you out illegally before getting the Writ of Possession, you can sue him/her in court for up to twice the amount of your monthly rent or free occupancy for two months, and the cost of the law suit that includes reasonable attorney's fees.
If you are locked out now and cannot get back in your unit, Legal Aid has another self-help packet called "How to Stop Your Landlord From Locking You Out Illegally." This packet will help you on how to ask the court to order your landlord to let you back in your unit. Check the file below to get this packet.