The short answer: the key is understanding that you do not need them.
The long answer: it is when you can look at your person with all the romantic, platonic, or any type of love you feel and understand that you can walk away at any time.
You do not need them to breathe. You do not need them for the blood to flow through your veins. You do not need them to laugh on a summer's day or to smile during the holiday season.
In fact, you don't need them at all.
And that is the most important lesson of all: to comprehend that you do not need anyone in your life other than yourself. You, yourself, is enough. Your own happiness is enough. Your own self-love is enough, if not more than.
That being said, you should want others in your life. You should want to share that happiness and love you can offer with others, without losing your sense of self-identity. People tend to lose themselves in relationships and can develop an unhealthy codependency. But again, the only person you should be dependent on is yourself.
Circling back to my previous point, as you do not need that person, they do not need you as well. They also have every right to walk away at any time, because they do not rely on you to live, to breathe, or to be happy.
Being aware of this makes sure that you will never take that person for granted. You will never take advantage of their kindness, their love, their generosity. You will show them appreciation because of their choice to stay with you. They should do the same. They should want to share their happiness with you.
Knowing that you do not need the other is the key to a successful long-term relationship because this ideal is built upon gratitude for the other person. For being thankful that out of everyone in the world, they choose to have you in their life and you in theirs.