Quitting a job can be very satisfying. Maybe it wasn't a pleasant work environment, and perhaps your boss was less than kind to you. Even if you liked the company, the work, and the people, quitting your job might still feel like a victory if you're leaving for a better opportunity.

However, no matter how you feel about the job you're leaving, it's important to be professional on the way out. That means no gloating, no celebrating, and no bragging about your fabulous new position.

The way you leave a job will impact how that employer feels about you going forward -- and whether or not you realize it now, you may need a favor from your old employer some day.

A man leaves an office with a cardobaord box packed with his belongings.

There is a right way to quit. Image source: Getty Images.

How to quit

Once you know you plan to leave, make an appointment with your boss just over two weeks before your last day. Don't do it earlier unless you're worried that the news of your departure will become public in some other way (some industries are very small).

At the meeting, notify your boss in a professional manner that you intend to leave the company. Thank him or her and provide a reasonable explanation for why you're leaving. It doesn't need to be overly specific unless your new job directly competes with your old one. If, for example, you are in sales and will be going after the same clients, you should tell your employer so the company can decide whether to let you serve out your two-week notice period.

In non-competitive situations, it's fine to say "I have landed a new opportunity that I can't pass up," and it's also fine to tell your employer where you're going if you're comfortable with that. In all cases, you should give two weeks notice, or more if your industry has a longer standard notice window.

After you quit

Remain professional and treat your last days as you did your entire tenure. Show up on time, leave when appropriate, and don't slack off just because you feel like you can. In short, don't behave as if you have one foot out the door.

You should also be willing to help the company replace you. This could involve training someone or writing a hand-off document for a person not yet hired.

Be as professional as you can, not only because it's the right thing to do, but also because you may need things from your previous employer. If you burn bridges, a company may be slow to verify your employment history, and if a new employer requests documents for health insurance, retirement accounts, or anything else, they may get "lost in the mail." And you can also forget about getting a good reference when you apply for another job in the future.

Do it right, even if the company doesn't

Just because you handle yourself professionally does not mean your employer will return the favor. On your way out, you may get the cold shoulder or find yourself assigned to the worst tasks. As long as the situation is merely unpleasant and not dangerous, simply grin and bear it.

Your boss or employer may not appreciate that, but your coworkers probably will. You never know when you'll encounter someone again in the professional world, and doing the right thing has far more benefits than going out in a blaze of glory.