What does ending well mean and what gets in our way? I'll start with what I find stops us from ending well:
Not surprisingly, we mentally move on before we physically move on--and not ending well often hinges on this, for our minds are powerful. When we decide we are done, we are done. One classic example of this is the phenomenon known in schools across America as senioritis--when all the students on track to graduate in the spring find it hard to stay motivated to do their work. We all get that sort of feeling when we know we are about to be done with something--like a job or even a relationship. It's hard to keep putting in effort when you have already decided to move on. What this leads to, though, in addition to not fulfilling our responsibilities, is often some guilt over either not doing our best or of cutting corners on our way out the door.
It can also happen that we get caught up in the expectations and feelings of others as we ready ourselves to move on, weighed down by guilt or wanting approval. Other people aren't necessarily great at accepting change they haven't chosen and so they might be resentful, or they might just want nothing to change and fight the reality of the situation in front of them tooth and nail. Either of these responses can play out in unreasonable requests for us to work harder and more hours before we leave a job or to take on and finish a project on a short timeline. They can play out in mean or petty comments. They can play out in being given the cold shoulder. In the face of these reactions, we might find ourselves trying to make it better or keep the peace by acting according to what will make others happy or placate them rather than doing what we need. The reality of the situation is that you can't hold yourself responsible for other's feelings and create your own happiness. That is a losing battle (in this context or pretty much any other--but that is another blog post)!
Sometimes we end poorly because we have mixed or negative feelings related to moving on. Maybe we feel we have been forced out of an organization--either actively or passively--and this can lead us to want some revenge, often extracted by doing very little. Perhaps we feel we have been wronged in a relationship and we want to make the other person or people feel that same pain so we do something petty or actively mean. This approach to ending though usually ends in pain and bitterness--and it rarely actually makes us feel better for it doesn't undo what was done in the first place.
Having mixed feelings about an ending, even if they aren't necessarily negative, can mean that sometimes we end poorly because we would rather not cope with wrapping things up, or we don't know how to close out that experience or relationship. Say for example I am moving out of state and this means I will leave a job I really love when I do. I am excited for the move but I love these people and this work and it's hard for me to say good-bye. I act like nothing is changing for as long as I can--still engaging in my daily work and on the last day, I rush through hurried good-byes, never really telling people how much I enjoyed working with them and what our work together has meant to me. This can be just as dissatisfying of an end--because it doesn't truly reflect how I feel and because it is incomplete.
How do we manage the complexity of all the feelings we can have about moving on? First, cultivate self-awareness. Are you pissed off and feeling slighted? Are you just tired and ready for something new? Are you sad or even apprehensive? Knowing what you are feeling is the first order of business as it can indicate why you might lean in one direction or another in terms of your behavior as you wrap up.
To that self-awareness, add some reflection. What matters to you about how you move on? Why is that important? If you don't spend some time thinking about and planning how you want to end, chances are high you won't end as you had hoped. This is just as important if you are ending on a positive note as if you aren't. As I wrap up my coaching certification program, it's important to me to get everything I can out of my supervision and time with experienced coaches. That gives me a goal--something to focus on when I feel tired and just ready to be done with the homework and calls and readings.

The beauty of an ending you choose is that you do get to write it as you wish. Make it satisfying by aligning the way you end to the way you feel and your own goals. Choose what matters to you and then direct your time and attention to the right places so that you can end well in your own estimation.