It is illegal for a landlord to lock you out, change the locks, remove your belongings, shut off utilities (water, power, gas), or otherwise force you out without a court order. You can recover damages if they do.
Civil Code §789.3 prohibits a landlord from using 'self-help' to remove a tenant — including shutting off or interrupting utilities, removing doors/windows, changing locks, or seizing the tenant's property to make them leave. A landlord who does this can be liable for the tenant's actual damages plus statutory penalties for each violation, and the tenant may seek a court order to restore access. If you are locked out or your utilities are cut, document everything and seek help immediately.
SerenityLease provides general legal information, not legal advice. Consult a licensed attorney for situation-specific guidance.