I assume you mean to solve the problem of an anxious, avoidant, or disoriented/disorganized attachment style and how to move towards secure attachment. The first step is to take a test to become clear what attachment style you or your partner have and to acknowledge if there is a problem.
Because the ability for secure attachment was broken in early childhood, we need to get to know ourselves through understanding how early experiences are still affecting our adult relationships. This allows us to make sense of them and feel the full pain of our experiences and the unhealthy attachment style it created. We can then heal the emotional wounds by methodically analyzing and re-living partnerships that ended dramatically. This allows us to change our patterns of either avoiding close relationships and intimacy, or being anxious about being abandoned (or a combination of the two) by rewiring our brain. The best way to heal any lingering unhealthy patterns is to be in a love relationship with a supportive and empathetic partner who has a more secure attachment style than our own, and by being honest with him or her about our feelings and impulses. A mindfulness practice can be an additional supportive tool.