In almost every state, landlords must provide rental property that is in good repair and meets basic structural, health, and safety standards. If a landlord fails to do so, tenants may have the right (depending on the state and the specific problem) to withhold rent, make necessary repairs and deduct the cost from the rent, move out, sue the landlord or pursue other legal remedies.
In addition to the landlord's responsibility to provide safe and habitable housing, tenants must keep their rental unit clean and safe (for example, by properly disposing of garbage). If a rental is made uninhabitable by a tenants's actions (for example, if a tenant carelessly breaks the heater), the landlord may bill the tenant for the expense (or deduct the costs from the security deposit).
Depending on the circumstances, a landlord may also evict a tenant who violates their legal responsibilities by damaging rental property.