If you have an insecure attachment style you may become more secure when you date/ befriend secure style individuals. Conversely you may become more insecurely attached if you choose insecurely attached company / partners.
People with a secure attachment style decreased from around 1/2 of the population in the late 80s to 4/10 people this decade (Konrath et al 2014) - which suggests we may be collectively feeling less safe in our relationships.
Often it is our caregivers that created the original trauma that made us have negative associations with either closeness or distance. But our inner child continues to be reprogrammed by our adult interactions.
Having a toxic relationship can turn a secure style into insecure
Anxious and avoidant partners are often drawn to each other and can bring out the worst in one another e.g. The anxious partner feels unloved and abandoned by the avoidant and becomes emotional, demanding, critical or quietly resentful, feels more insecure and unlovable. The avoidant partner feels trapped by the anxious partner's need for affection and withdraws further, closes down emotionally, refuses to take responsibility for the hurt caused or feels guilt but continues to self sabotage. (If you are fearful avoidant you might be either avoidant or anxious in the dynamic)
People often also befriend people who share their attachment wounds. But having a circle of friends that is mainly avoidant for example, can be counterproductive to learning how to lean in to intimacy (which doesn't mean we have to abandon friendships but we can observe what subconscious beliefs might be rubbing off on us and be mindful of if we want to seek relationship advice from them etc)
Secure friends can give us a window of insight into how healthy relationships work
Secure partners soothe our fears and are more flexible (give more reassurance, space etc as needed)
You may also want to distance yourself from family members who are unhelpful in your healing process and/or who co-created the attachment wound with you in the first place. It's not selfish to choose to heal and let go of being enmeshed with your family, needing their approval or feeling ashamed.
Your happiness matters.