In the months leading up to the end of your rental lease, some important decisions about your living situation need to be made. Sure, you need to find a new place. But moving from one apartment to the next is not as simple as finding a new place, packing up your stuff, and driving away without ever looking back. Truthfully, you can do that, but don't expect to get a penny of your security deposit back, or a glowing reference from your landlord.

Any good tenant who wants to leave amicably should heed the following advice on how to end a lease the right way.

1. Notify your landlord you want to move before your lease term ends

Before your lease is set to expire, you need to let your landlord know you won't be renewing. Look at your lease to see how many days' notice you must give before you actually leave. In most cases, there will be a set time period requested.

Once you've determined this, send your landlord a written notice of your intentions. If you do not let your landlord know you're leaving, you could end up paying for another month's rent or possibly lose some or all of your security deposit.

2. Clean up your home

It may be tempting to just hightail it out of there and leave the mess for the next tenant—or a biohazard-outfitted cleaning crew, as the case may be—to deal with. But if you want to get all or most of your deposit back, you're going to have to do some of the dirty work to leave it as close to its original condition as possible.

“Leaving the property dirty is the fastest way to lose a security deposit, because the landlord will likely [hire] a cleaning crew and charge you for it,” says Justin Taber, a real estate agent with Taber Realty Group in Columbus, OH.

Taber recommends asking your landlord for a cleaning checklist, or a walk-through with you to assess what needs to be done before you move out.

Try to fix anything that isn’t normal wear and tear. Wear and tear is typically considered any damage caused by natural forces (e.g., sunlight causing paint discoloration, dirty grout, and loose door handles). Anything more than that is where landlords normally start to charge you for repairs.

“Doing some minor repairs like using spackling paste to fill holes goes a long way, as it shows that you made an effort to restore the place as best you could, even if only with small fixes,“ says Tammy Dusharm, a landlord and tenant lawyer in Pennsylvania. “Landlords are still people, and almost all of them will appreciate you making an effort, which may win you some brownie points when it comes time to getting your deposit back.”

3. Document the state of your home

Consider taking pictures or video of the apartment if you're worried about the landlord claiming damages after you've moved.

"Cellphones make this easy, as you can just snap anything notable as you do an initial walk-through," Dusharm says. "It provides evidence, rather than a he-said-she-said situation, which makes it difficult for the landlord to dispute.”

Keeping a written record of physical defects in the home from the moment renters move in can help them get back more of their security deposit.

"When you do the walk-through with the property manager or landlord, ask for something in writing that states whether there are any deficiencies.” says Elizabeth Whitman, a real estate broker and attorney with Mirsky Law Group in Washington, DC.

4. Leave a forwarding address

Want your security deposit and future bills to make it to your new place? Leave a forwarding address with your landlord. You will also need to contact your main post office and have your mail forwarded for at least six months to ensure you get all your packages, subscriptions, and other materials.

5. Return your keys

Your landlord will ask for any copies of keys for your apartment and may charge a fee for each day you keep the keys past the due date.

When do you get your security deposit?

If you have abided by the terms of your lease and left the apartment reasonably clean and in good repair, then you're entitled to the return of at least some of your deposit, says Gary Malin, president of Citi Habitats in New York. Generally, landlords need to hand over the funds to you within 30 to 60 days, unless another time frame is specified in the lease.

And if you don’t receive it in that time frame?

"If there's no resolution after repeated calls to your landlord or management company, send a letter via courier service or registered mail demanding your security deposit back,” Malin says. ”If you can, have an attorney assist you. If that gets no results, your last option is small-claims court, or civil court if the value of the deposit is greater than $5,000.”

What if you don't want to move out?

If, on the other hand, your lease is coming up and you want to stay put, contact your landlord two to three months before its end.

“It costs the landlord money to prepare for a new tenant, so they're usually happy to see good tenants stay,” Whitman says. “By asking early, this will give you time to discuss and negotiate the new lease terms without being rushed, and it will give you time to find another place if the new terms are unaffordable."