In John 15:1-2, Jesus tells his disciples, "I am the true vine, and my Father is the vinedresser. Every branch of mine that does not bear fruit he takes away, and every branch that does bear fruit he prunes, that it may bear more fruit."
We get a picture of a skilled gardener moving along a grape vine with clippers in hand. He clears out the dead branches and trims the others. In doing so, he helps the branch produce better fruit in greater abundance. (If you have an apple tree, you know you get better apples if you cut it way back. Pruning rose bushes produces better roses. And if you want to grow really big pumpkins, you've got to hack the branch off just after the first sprouting pumpkin.)
For those who are not abiding in the Jesus, they are removed like the dead branches. However, for those who are producing spiritual fruit, God will prune you (or sanctify if you prefer the fancy word) so you will produce even more fruit.
Sometimes pruning hurts. It's painful to get trimmed. Why would God do such a thing? Is it only because he wants more fruit? No. Is it punishment? No, it's discipline in the sense that it is training and growing us. Hebrews 12:11 says, "For the moment all discipline seems painful rather than pleasant, but later it yields the peaceful fruit of righteousness to those who have been trained by it." Just one verse earlier it says, "[H]e disciplines us for our good, that we may share in his holiness."
We should celebrate that we're not the deadwood. And we must hold on to the vine. But we must also celebrate when the vinedresser sees fit to do some pruning. It may hurt, but it is for own good because the vinedresser loves us.