Painful feelings are mostly the result of the meaning we assign to events, not the events themselves. "She left me & that means I am this that and the other and am doomed to be lonely forever". The pain of having to re-adjust to an existence temporarily less joyful is much smaller.
We can choose what meaning we attach to events, even though it takes time and effort to learn to.