Doing the work
The same lesson will simply present itself in similar form in another person, house, job, city, country or circumstance.
At a physiological level 'pain' is a signal that we need to take action and it is no different when the pain is emotional or psychological. Seeking to merely remove the symptom of pain, whether physical or mental, will simply drive the 'cause' deeper.
Do the work which will enable you to reach a place of balance and then move on to the new person or circumstance. That way you will 'travel' freely, with no baggage and no demons to project onto new people or situations.