Let's be clear: the thing that caused the pain may well have been a bad thing. The pain itself, however unpleasant it may be at the time, is a good thing in that it's a necessary part of grieving. Of course it hurts! If it didn't hurt, it wouldn't have mattered so much, would it?
Pain doesn't go away, pain is put away. It's no longer needful to hurt, because the pain has served its purpose. But the pain is part of you, even when it isn't hurting. It informs your actions, your relationships with other people. It's part of learning. A human being who never went through any sort of emotional trauma might not be something that we'd necessarily recognize as a person, because that sort of trauma goes into building our empathy for others. (ObSFReference: see Niven, re Teela Brown.)
This is not a call to cherish your pain, but rather a call to use it as long as you need to and then put it away, where you'll be able to find it again when you need it.
Joy is tremendously pleasant. We're unlikely to be able to go through life in a constant state of joy. Life is seldom so cooperative. But you can take that joy when you're done with it and put it away, where you'll be able to find it again when you need it.
It's certainly more fun to take out the joy and look at it. And there will be times when that's the absolutely right thing to do, because you need to feel that joy again. When you're done with it, put it back away. It'll be there again when you need it.
The pain's there too. And sometimes, you'll need to take it out and look at it, just to remember why something caused you this much pain, because it will help you appreciate what you have, because it will help you remember how not to make a bad decision. And when you're done with it, you'll put it away.
But now it gets tricky. If you're a writer or a performer, you've got the numbers for that joy and pain on speed dial. Joy and pain and all the other feelings are part of making it real, making it live for the people that you're writing or performing for.
I cry when I'm writing songs. A lot. Not all the time, but when I'm putting the character in the song through the wringer, because I care about him, because there's a little bit of me, of what I know, of what I've felt, that's helping him walk through the fire. Because at some time in my life, I've known the pain or the joy that he's feeling. Even if it has very little to do with my life now.
I cry sometimes when I'm writing happy songs, just because I'm that damned happy, because I feel that good. I cried when I wrote Dance by Starlight, because it felt so good to be able to say those things and because I was on the opposite side of an ocean from Gretchen and I missed her so much at that moment. And those were all good things. And I cried.
And when I sing Too Many Years and I get to the end of the song, where the protagonist has to let the woman he loves go, I reach back into the pain, and I brush it -- very gently, because if I open it too far, I'll break right there -- and I let him hurt. Because he needed to hurt and because the folks that I'm singing for need to hear him hurt.
That's what I owe them.
That's what I owe myself.