While there are many reasons for leaving a job, there’s only one good way to do it: gracefully. A classy exit helps generate positive feelings with your soon-to-be-former colleagues and cements your status as an exemplary professional.

Most people understand that a clumsy and awkward departure can reflect poorly on them. But there’s more to a successful offboarding than avoiding blow-ups and bitterness. Here are some other do’s and don’ts for how to resign that can help you make a great last impression when leaving a job:

DO tell your boss first

Tell your manager before broadcasting news of your resignation to the world via social media. Do the informal part first — a brief meeting, either in person or virtually, where you say you’re leaving and offer to help with the transition.

Follow up with a formal resignation letter, which should include your departure day (two weeks’ notice is standard) and a sentence or two thanking your employer for the great learning opportunities the job provided. It shouldn’t include your reasons for leaving, what you disliked about your job or any unsolicited advice on how the organization can cope in your absence.

Get tips on how to write a resignation letter in this post.

DON’T leave your team in the lurch

If possible, avoid resigning at a challenging time for your employer, such as during the middle of the firm’s busiest season or the day before your boss goes on vacation.

Also, if you’re leading a project into its final stretch, consider extending your handover period so you can finish the initiative. Your flexibility will cost you nothing, but it will win you extra goodwill (and a potentially stellar reference in the future) from your current employer.

DO build new bridges when leaving a job

No matter the circumstances of leaving a job, try not to burn bridges as you make your exit. Focus on fortifying and building new ones, instead. In the age of online networking, you can lay the foundations for lasting relationships with your soon-to-be ex-coworkers. As you say goodbye, offer to connect on LinkedIn or any other forums you’re active in.

Also, don’t assume that close colleagues in your immediate work group are the only ones worth staying in touch with. You never know whose help or recommendation you might need down the road. So, even if you didn’t work with someone directly but respect them and would like to stay in touch, extend them an offer to connect.

DON’T vent in your exit interview

Exit interviews give human resources (HR) managers the chance to get some honest feedback on working conditions, company policies and more. But keep in mind that these meetings are not forums for you to air personal grievances.

Instead, offer fact-based insights into why you decided to leave. For example, you might present figures showing how the firm’s perks and benefits have fallen behind industry standards if that’s a reason for your resignation.

Finally, be sure to thank the HR team for a smooth offboarding process. It’s just one more opportunity to make a positive, lasting impression with your current employer that you should take.

DO offer to help train your replacement

Showing your replacement the ropes speaks to your conscientiousness and professionalism. It’s also a way to keep your legacy alive — think of the long hours you spent setting up and refining your work processes or bonding with clients by learning their particular likes and dislikes.

It’s also worth remembering that the ability to train people is a highly valued leadership skill. So, why not take the opportunity to sharpen it while leaving a job?

DON’T entertain a counteroffer

If the company doesn’t want you to leave, management may offer you financial or other incentives to stay. While it’s nice to feel wanted, accepting a counteroffer is risky.

Ask yourself whether the status quo plus a salary bump is all you were looking for when you started your job search. If you were eager for a new challenge, it wouldn’t be long before that anxiety kicks in again and remember that opportunity doesn’t always knock twice.

Not sure what level of compensation your skills and experience could command in today’s job market? Check out Robert Half’s latest Salary Guide for insights.

DO tie up any loose ends before leaving a job

Out of sight isn’t always out of mind. If your colleagues have to tidy up your cubicle or placate angry clients who had no idea you were leaving, you’ll be the talk of the office — and not in a good way.

To prevent this, brief your supervisor and coworkers on where you left off on projects they are taking over. Anticipate pain points and patiently address any questions your team may have. If you don’t have the chance to train your replacement, leave detailed instructions for your colleagues on how to find critical files and documents.

DON’T drop the ball on your last day

Remember that you’re still on the company payroll until the last hour of your final day. Carry out your remaining tasks, but leave enough time to hand over security badges and other company assets. If you’re working remotely, you may need to meet with an IT manager about equipment return and relinquishing access to company systems.

Keep things positive as you say goodbye to colleagues but also play down any elation you may feel about leaving. The less drama, the better. Handing in your resignation is never an easy process, but if you approach it with tact and grace, you’ll leave the company in the best light possible and with fewer hard feelings all around.

A final note: After announcing that you’re leaving a job, your employer may want you to depart the organization sooner than you’d planned. For various reasons, some companies will decide to accelerate the process of formally cutting ties after a worker resigns. Don’t take it personally; it’s just business. But do make sure you’re prepared to leave the firm promptly, just in case you’re asked to do so.