Can’t pay rent? It’s a situation no one plans for, but it happens. Maybe you lost your job or are facing some other financial troubles—and when that happens, we can see why giving that receipt to your landlord may fall lower on your list of priorities.

Still, before you bury your head in the sand and convince yourself that your landlord won’t notice that missing receipt. Rest assured, not paying rent will come back and bite you big-time. It’s best to take control of the situation—here’s what to do, how to approach your landlord, and what to expect in return.

Give ample notice

If this is just a bump in the financial road, the sooner you alert your landlord of the situatio. And, more important, your plan to remedy it—the more likely they may be able to work with you.

Because your rent is part of my income, the more time you have to budget for this lack of funds, the more inclined you are to work with your landlord on a payment plan.

Eviction can be a long, costly process, as is, finding another quality tenant.

If your plan is solid, new job starting next week, the landlord will probably listen. Try to have this conversation over the phone or in person, which is better for empathetic negotiations.

If, on the other hand, you’re facing a long-term challenge paying rent and really don’t know when the money is going to come in. Don’t panic that your landlord could kick you out tomorrow. Landlord-tenant law varies, but in most instances, the landlord has to give a written warning before going through an eviction.

Every day the warning is delayed is another day of keeping the place.

Pay as much as you can now

Another smart move? Figure out how much you can pay now and offer to pay your landlord a portion of the rent on time.

Adding that if you’re a trustworthy tenant and can show real effort that you’re, say, looking for a new job, there is hope to salvage the relationship.

If you have a decent percentage of the rent—say, anything more than half. You can contact your landlord and explain how much you can currently offer along with when the rest will follow.

If you’re not upfront and direct about it, however, then your landlord can’t trust you. Hence, they’ll move as quickly as possible to find a new paying tenant.

Put everything in writing

After you have had the conversation with your landlord, you should put everything that was agreed upon, including payment plan information (i.e., you will pay the full rent by X date), in writing.

The reason: Documentation is crucial in case you end up in court. It goes both ways. Regardless of your relationship status with your landlord. You’ll have to legally document the fact that you missed rent to protect yourself.

Check your lease agreement for late fee policies

Be prepared to pay a late fee or a surcharge on a payment plan if it’s noted in your rental agreement. (Good news: If it’s not in the agreement, you can’t be arbitrarily charged!)

If there is a clause noted, you should kindly ask your landlord to forgo the fee, especially if this is a one-time occurrence. If there is a late payment penalty clause, a landlord cannot collect a late payment penalty until you are 30 days late with the rent. So you have some time to gather the funds.

Bottom line: Be upfront and honest, and present a solid plan for paying your rent. That’s your best chance for avoiding eviction, which is your No. 1 priority.

Depending on the state the landlord may go file the eviction anyway, and that can instantly affect the tenant’s chances at housing in the future.