When the novel opens, Lily Bloom sits on the roof of a building in Boston, looking out at the city and the stars, thinking about death. She’s just come from her father’s funeral. She’s reflecting on how much she resents her father for abusing her mother when a man joins her on the roof and starts angrily kicking a patio chair. The man, Ryle Kincaid, is a neurosurgeon, and the two begin to flirt and tell each other increasingly intimate “naked truths.” Ryle reveals that he lost a child patient because the child’s brother shot him accidentally. Lily tells Ryle that she gave the eulogy at her abusive father’s funeral and couldn’t think of anything nice to say, so she stood there for two minutes in purposeful silence. Lily also tells Ryle she lost her virginity to a homeless boy named Atlas. Ryle tells Lily he wants to sleep with her, but he only has one-night stands and never wants to get married or have children. Though Lily is interested in Ryle, she can’t imagine having sex without it leading to a relationship.
Six months later, Lily uses her inheritance to buy a storefront to convert into a flower shop. A woman named Allysa offers to work for Lily, and the two become fast friends. Lily and Allysa are cleaning up the storefront when Lily falls and hurts her ankle. Allysa calls her husband Marshall and her brother for help. When Allysa’s brother arrives, Lily sees that it’s Ryle. They pretend not to know each other for Allysa’s sake, but Ryle tells Lily that he still wants to sleep with her. They decide they need to stay away from each other because they want different things. As Lily recovers from her sprained ankle for a week, she reads her teenage journals, which were written as letters addressed to Ellen DeGeneres. They tell the story of Atlas and Lily.
As a teenager, Lily notices a boy is living in an abandoned house behind hers. She feels for Atlas and begins to leave him food, lend him her father’s clothes, and let him shower at her house. The two become closer and begin to fall in love, and Atlas becomes a confidant and protector for Lily when her father hurts her and her mother. The two watch Ellen and Finding Nemo together and tell each other to “just keep swimming” when times get tough, quoting a line from the movie. Atlas learns a family member can take him in in Boston, and though Lily dreads it, Atlas moves away to find more stability. She’s heartbroken, but he returns on her 16th birthday. He gives her a magnet that says that everything is better in Boston. They make love for the first time. Atlas promises to come for Lily when he feels that his life is good enough for her. Then Lily’s father walks in on them. He savagely beats Atlas with a baseball bat. Atlas is taken away in an ambulance. This is the last time Lily sees Atlas, and throughout her life, she wonders why Atlas never came back for her.
Back in the present, Ryle pursues Lily, and after trying to get her to have sex with him, he admits he has feelings for her. Lily insists they not have sex and try dating, since she doesn’t trust him to have a relationship with her. They quickly start falling for each other. After they have been dating for a bit, Ryle invites himself to dinner with Lily and her mom. At dinner, Lily sees Atlas working at the restaurant. She’s shocked. During a brief conversation, Atlas tells Lily he has a girlfriend but that he wishes they had run into each other a year ago. Lily doesn’t tell Ryle that she ran into Atlas and tries to avoid going back to the restaurant again. One night, when Ryle and Lily are hanging out, Ryle burns himself on a casserole dish he tries to take out of the oven without a mitt. When Lily laughs, Ryle pushes her, and she hits her head. She’s bleeding, and she feels horrified and heartbroken, immediately worrying she’s turned into her mother. He’s quickly apologetic and eventually she forgives him, saying that if anything violent happens again, she’ll leave him.
They go to dinner with Allysa and Marshall at the same restaurant where Atlas works to celebrate that Allysa and Marshall are going to have a baby. Atlas comes to the table and the waiter introduces him as the chef. Atlas notices that both Lily and Ryle are injured and intuits that Ryle hurt her. When they are alone, Atlas tells Lily to leave Ryle. When she refuses, he says she’s like her mother. Ryle sees them together, and he learns that the chef is Atlas, the boy from Lily’s past. It comes to blows and Atlas throws Ryle out of his restaurant. Lily assures Ryle that nothing is going on between her and Atlas. They enjoy a period of peace and decide to get married in Vegas. But Ryle’s jealousy continues to simmer. When Ryle discovers that Atlas has given Lily his phone number, he flies into a jealous rage and pushes Lily down the stairs. She’s badly injured. When Allysa finds out what happened, she insists Ryle tell Lily about his past. He confesses that, just like the young patient he lost the night they met, his brother died of a gunshot wound because Ryle accidentally shot him. He marks this as the origin of his rage. Lily forgives him, and they try to be together again.
Allysa and Marshall have a baby and name her after Ryle. The night Rylee is born, Lily comes home to find Ryle in a strange mood. He makes her read an article in the newspaper in which Atlas mentions a woman who is special to him and says that the name of his restaurant (Bib’s) means “Better in Boston.” Ryle has the magnet in his hand and has read all of Lily’s teenage journals. He attempts to rape Lily and headbutts her so hard she blacks out. She calls Atlas to come get her, and he takes her to the hospital, where she discovers she’s pregnant. She takes her time figuring out what she wants for her life, confused by her emotions for Atlas and by all her conflicting feelings of rage and love and hurt for Ryle. She gradually lets Ryle back into her life in a platonic way, telling him about the baby, though she’s unsure what she wants from him.
When the baby is born, Lily and Ryle name her Emerson, after Ryle’s brother. Lily says she wants a divorce because she would never want her daughter to endure what she and her mother did. Ryle agrees, though he is heartbroken about it. They share custody of Emerson. One day, Lily runs into Atlas. He says his life is good enough for Lily now, so if she’s ever ready to fall in love again, he’s there for her. She says she’s ready, and they embrace. He says she can stop swimming.