very broad question that's not easily answered without knowing where you stand.
the best answer would probably be "by working on being a sane and mature person yourself".
ofc there are a lot of nuances and many processes you need to be aware of to actually lead a healthy relationship for decades, but explaining them all would definitely be too detailed for the limited space of adv posts.
i can give you a few keywords.
>real intimacy
>inevitable injuries and how to deal with them
>colaboration instead of collusion
>learning to not depend on outside validation
>commitment
>ability to sooth yourself
>sexuality
>taking your partner seriously
>ability to be in controle of your emotions
if you want to seriously learn about the dynamics of long term relationships, read into the works of david schnarch. you'll thank me later.