If you’ve ever failed to deliver on an assignment, you know how defeating it can feel.

Perhaps you were bogged down by a family emergency. Maybe you were young, stupid, and careless enough to not give your work the love it required. Perhaps you overestimated your skill and underestimated the time you’d need to finish the piece. Or maybe you just misunderstood the editor’s expectations.

Whatever the reason, you screwed up. And now you’re worried that you’ve lost a perfectly good client.

As freelancers, we don’t often have the luxury of being given second chances. But with the right approach, it’s possible to make things right; believe me, I’ve done it. After 14 years of freelancing and plenty of botched assignments later, I’ve come across five successful strategies for dealing with failure—and ultimately getting that client back.

1. Take responsibility

The best thing you can do when you’ve messed up and you know you’ve messed up?

Take responsibility and apologize.

If editors are to be believed, not enough writers do this. They miss a deadline, get embarrassed, and fall off the face of the earth. Unsurprisingly, editors really do not like this practice. Most editors agree that while the best solution to a missed deadline or a story riddled with mistakes is to warn them in advance, the second best is to apologize honestly and earnestly.

“We understand that mistakes happen,” says Mary Hoff, editor-in-chief of environmental publication Ensia. “What works for us is when an erring writer owns the mistake, apologizes for it, helps undo any damage done to the extent possible, and tracks down how it happened and shares that information with us so we can both learn from the experience. If the writer makes excuses, blames other people, or tries to convince us it’s no big deal, we would be less likely to want to work with him or her again.”

2. Go out of your way to do something nice

A friend of mine once sent a box of chocolates to an editor after an argument about comma placement. (It’s always about commas, isn’t it?) That may seem extreme, but remember: Your editors are people too, and they appreciate friendly gestures as much as anyone.

Another friend once called an editor on his birthday. Her reasoning? It’s harder for someone to stay mad at you when you’re talking to them on the phone and wishing them a lovely day. This friend ended up having a fantastic phone conversation with the editor that cleared the air; they continued working together for many years after.

Again, honesty, openness, and a good sense of humor can help here. If you’re genuinely regretful of your mistake and can take responsibility for it, most reasonable people will let bygones be bygones after a kind gesture or email.

3. Offer them something irresistible

The best way to get back into an editor’s good books is by offering him a story so juicy, so compelling, and so perfect for her audience that she has no choice but to forgive you.

This, of course, is often easier said than done.

My strategy with editors I like and don’t want to lose is to break them through sheer persistence. I’m the gal who sends 30 queries in 30 days, after all. I’m used to being ignored, but no editor will ignore a writer she trusts for long. If you’re consistently bringing great ideas to the table, it’s in the editor’s best interests to give you another shot.

4. Establish credibility

Can you make a mistake and come out more likable? Yes.

This is explained by the pratfall effect, a psychological phenomenon that makes smart, competent people appear more likable and attractive if they make a mistake than if they’re perfect. Think of Superman and Batman—everyone loves Batman more because he’s flawed and eminently human.

In other words, smart, competent people who make mistakes appear more human and appealing to us as fellow mistake-makers. But we have to believe that they’re competent in the first place.

As Ilima Loomis, a freelance writer who has written for publications like Popular Science, National Geographic Traveler, puts it, “If you file ten stories on time and do great work, you’re banking credibility and your editor isn’t going to worry if you miss a deadline on the eleventh story.”

This will only work if you’ve put in plenty of good work already. Assuming you have, own up to your mistakes while also pointing to your previous success. You may just come out the other end with a better relationship with your editor than ever.

5. Let it go

If you’ve tried explaining yourself, offered up ideas, and still can’t get anywhere with a particular editor, let it go.

The energy you’re spending on chasing this client or that editor is likely taking you away from serving your existing clients or, more importantly, finding new ones, especially if the conversation is devolving into unprofessional territory.

“I try to always stay calm, professional, and take the high road,” says Loomis. “If an editor gets snippy, I never respond in kind. You always want to bring the tone back to a professional place, you should never be the one escalating the situation.”

If an editor or client is unwilling to meet you in the middle, move on, find a new client, and prepare for plenty of more mistakes down the road.

Because here’s the thing: You’re going to screw up. Just accept that. Ultimately, though, how you deal with a screw-up is what determines whether you keep your clients or lose them.