The strong jobs recovery has prompted a lot of workers to part ways with their employers – in many cases, to pursue jobs offering more flexibility or better pay.

In June, nearly 4 million workers quit their jobs, according to the latest Job Openings and Labor Turnover survey from the Bureau of Labor Statistics.

But when it comes to leaving your job, there should be more to it than walking into your boss’ office and yelling: ‘I quit!’ (No matter how tempting that might be.)

How you leave your current job can affect your career down the road and you don’t want to burn any bridges. Here’s how to do it right:

Tell your boss first

You might be excited to share the news of your new role with your work friends, but your boss should be the first person to hear about your exit.

“It is a courtesy,” said Marianne Ruggiero, founder and president of Optima Careers. “They are the people who likely made the decision to hire you and you want them to have a chance to understand and get information and make a plan.”

If possible, have this conversation in person or, if you’re working remotely, on a video meeting.

When having the conversation, Ruggiero recommends getting straight to the point by saying something like: “I want to let you know that I’ve decided to take a new position and am resigning from my position effective [provide date].”

If the boss seems surprised by the news, Ruggiero suggested following up by saying something along the lines of: “I’m very grateful for all that you’ve done for me and I hope you understand that I’m doing this to advance my career. It will be an opportunity to further my skills or leverage my skills or learn more about…”

Alison Sullivan, career trends expert at Glassdoor, suggested discussing with your boss about how best to inform your colleagues.

“Think about how you are going to communicate with your team and boss and what you are going to say about the reasons you’re leaving,” she said. “Make sure to be clear and be supportive in helping the transition process.”

Give some notice (if you can)

Giving at least two weeks’ notice of your departure has become a generally accepted norm.

The heads up helps managers figure out things like how to shift your workload, get up-to-date on the status of assignments and inform clients

While it’s not necessarily a requirement to give that much notice, departing abruptly could have negative consequences, including leaving a poor impression and having co-workers wondering what happened.

“If you have some sort of agreement that has a different notice period then you should follow that because you could lose out on other benefits that you might be entitled to,”said Davida Perry, managing partner of Schwartz Perry & Heller in New York City.

You should also be prepared to be asked to leave the day you give notice – especially if you are going to a competitor.

“Most people know before they’ve resigned what the general convention is in that particular environment,” said Ruggiero.

The resignation letter

If you’re asked for a resignation letter, Perry advised keeping it short: thank your employer for the opportunity and state when your last day of work will be.

However, if you’re leaving over a possible legal claim, such as an allegation of workplace safety violations, Perry advised speaking to an attorney before submitting a resignation letter. Anything in writing could be used against you later.

“If there is some illegal activity going on… you’re definitely going to want to push back or write a letter identifying the fact that you are not voluntarily resigning.”

Help with the transition

When delivering the news of your departure, have a plan to help your boss with the transition after you leave.

Career coach Hallie Crawford suggested being ready with a status update on all your projects and assignments, and offering up suggestions about which colleagues might take them over.

“Be proactive and have a transition plan. It will help smooth things over and make it easier on everybody. But make sure what you are promising you can do is realistic,” said Crawford.

Stay positive

Try to remain cordial and productive with your colleagues during your remaining time. You never know when your paths might cross again.

“These are the people who are going to be your next reference,” said Ruggiero, adding that you should also identify who you’d like to try to keep in your network as you move forward in your career.

Reach out to any sponsors and colleagues you wish to carry on relationships with and ask them to have coffee or lunch with you before your departure.

“Pick a handful of people you’d like to stay connected with and let them know that,” said Crawford. “You want to close your professional relationship out with people properly, just as if you are onboarding, you want to offboard correctly as well.”

Don’t waver

Even though you might have spent hours deliberating about moving, your boss might still try to make an offer to keep you on board.

If you’ve already concluded you are leaving and have accepted another offer, Crawford advised being direct.

“You need to stick to your ‘no.’” She recommended saying something like: Thank you so much for the offer. I really appreciate it, but I’ve really made up my mind.

“Keep it short and sweet. If you start to say more, you might be leaving the door open,” Crawford said.