Soul mates Celeste (Rashida Jones) and Jesse (Andy Samberg) discover they’re meant to be together forever — as friends.

Most romantic comedies follow a simple formula: boy meets girl, boy and girl spend the next 90 minutes falling in and out of love until they live happily ever after.

“Celeste and Jesse Forever” is about what happens after happily ever after. Celeste (Rashida Jones from “Parks and Recreation”) and Jesse (Andy Samberg from “Saturday Night Live”) are best friends who fell in love, got married and later realized they should have just stayed friends. As the film opens, Celeste and Jesse have been separated for six months but still spend every day together. Jesse even lives in Celeste’s backyard studio.

“There’s a lot of dramatic movies [where] all this stuff happens and you end up with the person you’re supposed to be with and you don’t see how that all pans out,” says Jones, who co-wrote the script with actor Will McCormack, a friend.

Jones and McCormack met in 1999 after McCormack’s sister, actress Mary McCormack, became convinced the two were soul mates. They dated for three weeks but quickly realized they were better off as friends.

“[Mary] was kind of right,” McCormack says.

“Because we are” soul mates, Jones says. “Just not that kind of soul mate.”

Celeste and Jesse’s relationship mirrors her own friendship with McCormack, Jones says. “Their dynamic is our dynamic — the way that they talk, the way they communicate.”

In the film, out Friday, Celeste is a career-driven, independent woman at the center of her universe, while Jesse is an unemployed artist who won’t grow up. When Jesse meets another woman and moves out, Celeste spirals into a jealous depression, blaming everyone but herself.

For Jones, the role was a chance to play someone other than the sweet, good-natured characters she’s known for. “I remember Will saying to me early on that he was concerned about how unlikable Celeste was,” Jones says.

However, “it’s great to make a protagonist unlikable because then you get to root for them,” says McCormack, who plays Skillz, one of Celeste and Jesse’s friends.

“We all have these faults, so I feel like people can identify with the flaws.” Ultimately, the film is about Celeste confronting those faults and taking responsibility for what happens to her.

“We both feel like it takes so much in life to change you a little bit,” Jones says. “That’s real life.”

Landmark E Street Cinema, 555 11th St. NW; opens Friday, $8-$11; 202-452-7672. (Metro Center)