Until the court rules that the landlord can have possession of the premises, you can stop the eviction if you offer all of the past due rent and late charges unless you have violated some condition of the lease or rental agreement. (If there are late charges, they must be limited to $15 or 5% of the rental payment, whichever is more.) If the landlord has started a summary ejectment action, you must also offer to pay the court costs in order to stop the eviction.
Remember that stopping an eviction by offering to pay past due rent and court costs works only if there is no written lease, unless the Landlord agrees to accept late rent and costs. Get such agreements in writing.