A landlord must go through a specific eviction process before he can legally evict a tenant. This process varies a bit from state to state, but in general, a landlord must provide a written notice, and if the notice is ignored, he can file a lawsuit in court. It does take a court order to legally evict a tenant, and there are ways to stop it before it gets to that point.
Talk with your landlord to discover a way to remedy the situation. The written notice should have a cure clause on it in most cases. If you cannot cure the situation, such as by paying all back rent, you may be able to come to an agreement with your landlord prior to a court filing.
File a Motion to Quash after the eviction lawsuit is filed. This is a motion that indicates the tenant was either not properly served, or not properly notified. This motion typically is not accepted, but if it is, a tenant can delay up to 10 more days while the summons is served again.
File a Motion to Strike. This motion is also filed after the eviction proceedings has been started in court. It challenges the legal ability of the landlord to file an eviction, and it requires a written opposition as well as another court date. This can set the eviction back up to three weeks.
File for bankruptcy. A bankruptcy creates an automatic stay on court proceedings for the debtor, as long as those proceedings are related to the debtor's debt. A landlord then has to file for a Relief from Automatic stay. This requires the landlord's lawyer to petition in the bankruptcy court. The amount of time that this can delay an eviction depends on when a hearing can be held at the bankruptcy court.
File a Request for Stay of Eviction. This request is filed after the eviction proceedings are finished and the court has ruled in favor of the landlord. If a tenant is unable to move out within the amount of time that the court decrees, he can file this request to provide additional time to move out. The amount of time this delays the sheriff from evicting the tenant is dependent on the location.