There is no code to crack when it comes to making marriage work, but "Unstable" actor Rob Lowe has a few secrets he's willing to share after being married for over three decades. 

"It is not just Hollywood, it's everywhere. Marriage is hard.… It can be hard – marriage is not hard. If it were hard, nobody would do it. It can be hard. And will be hard," he shared on "Table for Two," an iHeartPodcast hosted by Bruce Bozzi.

"I have a couple thoughts," he told Bozzi on what has kept his marriage to make-up artist Sheryl Berkoff prosperous for 31-years.

"It's all about who you choose.… Sheryl was and is my best friend. So if you marry for anything other than the fact that it's your best friend, you're at a disadvantage from the jump. 'Cause that will sustain when the other stuff ebbs and flows," he explained.

Rob Lowe in a navy tuxedo laughs as his wife Sheryl wears a gold sequin dress and looks lovingly at him on the red carpet in Monaco

Rob Lowe offered insight into what has made his nearly 32-year marriage to wife Sheryl Berkoff work. (Arnold Jerocki/WireImage)

ROB LOWE RECALLS THE MOMENT HE HIT ROCK BOTTOM DURING ALCOHOLISM BATTLE: 'THIS IS NO WAY TO LIVE'

Another key element to his marriage: forgiveness. 

"People say marriage takes work. I'm not sure if it takes work.… But what it does take is forgiveness. And being really cognizant of what hill you're willing to die on," Lowe explained.

Bozzi suggested that it was important for couples to stay in the room for one another.

"You definitely have to stay in the room," Lowe agreed. "And then I think there is a sense maybe on the outside when one looks at a long marriage and goes ‘Oh, it's been – they're blessed.' True. ‘And it’s a perfect marriage.' There's nothing that's perfect."

Rob Lowe in a tuxedo takes a selfie with his wife Sheryl inside a theater

Rob Lowe emphasized the importance of forgiveness in a relationship. (Rob Lowe Instagram)

 CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

"I think the minute things go south for whatever reason it could be… many many many reasons, I think people can go, ‘Oh, I knew it. This, this is bad. This is a mistake. That marriages don't work.' Everybody has those dark periods," he said.

"When they come, and they do, just like a career, everyone has periods where it's not happenin' like you would like it.… Life is like that, it's ebbs and flows.… You just can't bail on the ebbs. ‘Cause eventually it’ll turn around if you're with the right person."

APP USERS CLICK HERE

In July, Lowe posted to Instagram a tribute to his wife on their anniversary writing, "Happy 31st Anniversary, baby. Your love has made my world. You are as beautiful, knowledgeable, fascinating, kind, and hilarious as you were so many glorious years ago. Partners in love for life!!"

The couple share two sons together, Matthew, 29 and John Owen, 28, whom he stars alongside in "Unstable."

Matthew Lowe in a black suit stands next to John Owen Lowe in a black suit next to father Rob Lowe in a blue shirt and fitted suit next to wife Sheryl in a black top and khaki colored skirt on the red carpet for "Unstable"

Sheryl and Matthew Edward Lowe, supported Rob and John Owen Lowe at the premiere of their new Netflix show "Unstable," loosely based on their real-life father-son relationship. (Gregg DeGuire/FilmMagic)

CLICK HERE TO GET THE FOX NEWS APP

Bozzi also told Lowe he thinks a great relationship needs heat.

"You need the heat, for sure," Lowe agreed.

"If you don't have the heat… and that's a chemical thing. That's like I still have it with Sheryl.… You got to keep the heat," he reiterated.

"By the way that comes and goes too. There are days, there are times when you're just like ‘Uhhh,’ and then all of a sudden you're just wild for somebody. It's one of the great human mysteries."