When you sign your lease, all signs point to being able to pay rent on time and fulfill the lease. However, life happens and circumstances change to where you, as a tenant, are sometimes unable to fulfill your obligation.
You may wish you had a DeLorean time machine like Marty McFly in "Back to the Future" in order to go back and right some of the wrongs you committed while you were a tenant.
The next best thing is to move out of the property in a timely manner and set up a repayment program to fulfil the rent owed for the unpaid portion of your lease. This idea may not seem like a good idea at the time. However, most property management companies would re-rent to a tenant who honors a repayment program. There are not enough rentals to fulfil the public need so keeping your reputation as a tenant is very important to your future.