“The Rules” is a Moneyish series where we define the rules around sticky money or workplace topics like giving an allowance, who pays on a date, combining finances with your partner, and more.

Never leave ’em hanging.

How you leave a job — and the amount of notice you provide before leaving — can have long-term implications for your career. Eighty-six percent of 600 HR managers in a 2015 OfficeTeam survey, for example, said that the way employees quit either somewhat (53%) or greatly (33%) affects their future professional opportunities.

And while the tried-and-true standard is to give two weeks’ notice, you technically “don’t have to give any notice at all” unless you signed some contractual agreement stating otherwise, said Phyllis Hartman, founder of the human resources company PGHR Consulting. “Is that smart? Probably not,” she added. “There’s a significant risk in some ways in just bailing with no notice.”

“What you always need to keep in mind,” Hartman said, “(is) no matter how much you dislike that employer or how happy you are to be leaving, it’s really very bad to burn bridges, because you just never know.”

Here’s expert advice from Hartman and others on what to consider when giving notice to your employer — and how you should spend those last few weeks and days on the job:

Also read: 4 signs it’s time to quit your job, like Hope Hicks just did

Consider how high up the ladder you are. If you’re in an entry-level gig, the minimum two-week notice is “still the standard as a professional courtesy,” said Rebecca Barnes-Hogg, a small-business hiring expert and CEO of YOLO Insights. But if you’re in a management role, she added, “you probably want to start looking at three, maybe four weeks.” For executive-level or senior management roles, Barnes-Hogg recommends at least four weeks and perhaps more.

“On average, people kind of expect … to give a two-week notice,” Hartman agreed. You should give more advance notice if you’re in a “highly responsible position” that’s important to the organization, however. In that case, Hartman advised giving as much notice as you can — possibly “up to even a month or six weeks,” since you’ve got more on your plate and are harder to replace.

Career coach Roy Cohen, meanwhile, says the notice you give “can be anywhere from two weeks to two or three months, depending upon what is standard for your company and for your level in the company.” “It all has bearing on the relationships you have, the scope of responsibility that you oversee, and any projects you may be working on that are critical,” he said.

If you’re leaving because of workplace abuse or harassment, Hartman said, ”all of the things that I’ve said … don’t count.” “If you need to get out of a bad situation, you should get out and not worry about all those kinds of other issues,” she said.

Consider the size of your company. For a smaller organization, Hartman added, giving lots of lead time can be critical — especially if it only has a few employees who are all “really significant” to the company. “In some nonprofits, I’ve seen people give as much as six to eight weeks’ notice,” she said.

Forge a smooth transition. Imagine you’re heading off on a two- to three-week vacation and want to be “100% gone,” Barnes-Hogg said. “What would I need to do in terms of making sure projects and workload and my responsibilities were covered so that when I left for that vacation, I wouldn’t have to worry about anything falling through the cracks or not getting done?” she said. Take the same approach with leaving for good.

“Tying up loose ends on projects is essential, (as is) cleaning up any messy situations to the best of your ability that other people may not really have insight to navigate easily,” Cohen said. “You need to be able to hand them off in a way that allows anyone who’s going to take those projects to understand what they need to do.” Show empathy for clients as well as coworkers, Barnes-Hogg added, notifying them you’re leaving and transitioning them to someone who’ll offer the same quality of service.

Also read: Meet the people who say they quit their jobs to save their marriages

If you choose to be candid about why you’re leaving, “keep it diplomatic,” Barnes-Hogg said. “There are a lot of opportunities, I think, to help an organization be better — whether it’s developing their own people or doing a better job of screening people during that recruiting and hiring process,” she said. If you feel strongly about something you’ve noticed in your organization, it may help to approach a more neutral third party like HR instead of your boss, Hartman added.

It’s best not to tell any coworkers before notifying your boss, Hartman said, since “you may trust that person, but they may trust somebody else who then trusts somebody else,” and it could make its way back to the manager. It’s OK to be honest about why you’re leaving, she added, and share that the job wasn’t the right fit or you weren’t happy — but there’s no need to trash your workplace, as “they may not have the options that you do to leave.”

Be wary if your new employer is pressuring you to start in a matter of days. “They have to agree that maintaining your reputation and doing the right thing is important,” Cohen said. “If they don’t, then you have to question whether or not their attitude may be a reflection (of) how they may treat you in other aspects of the job — will they be unyielding or inflexible when it comes to taking time off or vacation days, or working on weekends?”

But if the company’s urgent start date seems legitimate, Cohen said, then weigh whether it’s worth risking the relationship with your present employer. “While you can tell your current employer why you’re doing it and the reason for it,” Barnes-Hogg said, “it doesn’t take away the sting and it doesn’t take away the memory that you left them in the lurch.”

If you quit on unpleasant terms or otherwise dread an awkward two weeks ahead, try to “focus on the good,” Barnes-Hogg advised. “Suck it up,” Hartman said. “It’ll be very uncomfortable; you’ll be a lame duck; people will treat you differently — but do the best you can, because you want to leave gracefully.” Show up on time, volunteer for assignments you know you can complete before leaving, and treat others with respect, Hartman added. “Don’t start letting loose on people that you were unhappy with for a long time,” she said. “Just do your job.”

If you’ve already tied up loose ends and are just twiddling your thumbs, Cohen said, you might simply tell your boss so — after all, your company doesn’t want to pay you unnecessarily, and it certainly doesn’t want you distracting colleagues. “I’ve fulfilled all of my commitments; I’m really not doing anything at now now; it seems like a waste of time and energy to be sitting here,” Cohen suggested saying. “How would you feel if I wound down this week?” If you have unused vacation time, he added, now would be the time to use it.

If you’re asked to leave immediately, Barnes-Hogg said, you still “want to be the one who stayed professional.” “Don’t get defensive; don’t get angry,” she said. Instead, she advised, offer to spend a day or half-day helping to hand off your responsibilities and projects. “Always make that offer, so you can then leave knowing you did what you could.”

Spend your last days “relationship-building and politicking,” Cohen said. “Spend time individually with key colleagues, peers, bosses, other managers, and thank them — but also talk about what you learned on the job,” he said. “Regardless as to whether the situation was an amazing experience or a disappointing one, you still need to express your gratitude for the opportunity to have worked there.”