How do you stay married? By not getting divorced.

That’s a joke I heard recently, and there’s a lot of truth to it. You make it to your golden anniversary by not splitting up. It isn’t that easy, of course: No one wants to be in an unhappy relationship for 50 years. So what’s the real secret to making love last? It’s a combination of these 6 things:

1. Have a Mindset of Realistic Positivity. Realistic positivity means you see and accept what is happening now—both in your inner and outer world—and then put your focus on what you would love. The antidote to a relationship impaired by criticism and contempt, for example, is gratitude. The simple act of genuinely looking for and appreciating something about what your partner does will instantly begin to heal damage and turn your relationship around.

2. Build a Rewarding Relationship with Yourself. You will be most attractive to your significant other when you are happy and fulfilled independent of them, and vice versa. No matter how close you are to your partner, you remain individuals with your own needs. Mutual respect for each other’s independence and time alone will strengthen your relationship. Tara Parker-Pope, author of For Better, advises that “Your marriage should be your primary relationship—not your only one” (1). Be honest with yourself and your partner about what you want, and what you don’t want. You must tell your partner what you need for your needs to be met. No matter how much your partner loves you, they can’t read your mind.

3. Develop Your Emotional Intelligence. Relationships are wrecked when people lack emotional intelligence. When you don’t know how to recognize and deal with your emotions in a healthy way, screaming fights or seething resentment are bound to happen. To manage your emotions, you need to be aware of them—as they are, not as you imagine they should be. Once you’re aware, you anticipate that your partner has similar feelings and develop empathy for them. Building this connection between yourself and your partner creates an internal motivation: You want to treat your partner as you would like to be treated.