Vacating Apartment before eviction hearing (Late rent) Advice

r/

Basically as title says, want to see anyone’s thoughts on what do when fallen behind on rent and facing eviction? If I am a few weeks out from a court date (served summon) and a couple weeks late for rent, would eviction still go through if I let my Landlord know I am giving up possession of the apartment (cleaning and turning over keys) and vacating before the court date. I am planning to try and come up with a plan to pay off the back rent with them after leaving as well. Location: Kentucky