This post contains spoilers from the series finale of A Million Little Things.
A Million Little Things bid farewell on Wednesday as its main characters said a tough goodbye of their own.
When Wednesday's finale began, Eddie (David Giuntoli) and Maggie (Allison Miller) find her husband Gary (James Roday Rodriguez) looking sallow, unable to talk and unwilling to eat in his hospice bed. Gary agrees to drink a milkshake, and while Maggie walks away to make it, Gary writes something on his whiteboard that causes Eddie to pause trying to feed him eggs airplane style.
"Are you sure?" Eddie asks.
A Million Little Things: Delilah Gets Shamed by Nurse for Struggling to Breastfeed Newborn
Eddie proceeds to call Rome (Romany Malco) and asks Rome to meet him at his house. "Are you saying what I think you're saying?" Rome wonders.
In a flashback, Rome is seen filming a home video of Gary when he could walk and speak. Rome and Gary gang up on Eddie for thinking Aaron Burr was Black because of Hamilton. Then, Gary requests Rome stop filming and asks him and Eddie "to help me end it."
Never miss a story — sign up for PEOPLE's free daily newsletter to stay up-to-date on the best of what PEOPLE has to offer, from juicy celebrity news to compelling human interest stories.
They try to make light of it, but Gary says, "Guys, I'm serious. If by some chance things go south, I do not want to be stuck in some hospital bed in pain, crapping myself and wasting away into nothing. So, if we get to that point — which we won't — I need you to go see Kevin, okay? He'll know why you're there."
Gary explains that nurse Kevin will give them "the right drugs" that will "put me out of my misery." Rome protests, citing how Gary and Edie helped him overcome depression. Gary says his situation is different, that this is only Plan C, and Maggie doesn't know about it.
"I cannot let Maggie watch me suffer and die from the same disease that she has battled twice," Gary says of his cancer. "It's called death with dignity and that's all I want."
Rome and Eddie reluctantly agree but say that if it comes time to enact this plan, Gary needs to tell Maggie.
Back in the present, we see that Gary wrote "Rutledge" on the whiteboard, referring to Jon's (Ron Livingston) plan to make sure he took care of his friends after his death.
RELATED VIDEO: Wendi McLendon-Covey Reflects on The Goldbergs' 'Heartwarming' Run Ahead of Series Finale
With that, Rome and Eddie go to see Kevin, who says he can't help them because it would cost him his job. Instead, Kevin packs up a brown paper bag with what he tells Rome and Eddie is a gelatin cup for Gary to eat. "Thanks for nothing," an angry Rome tells Kevin.
In the car, Rome and Eddie try to come up with a Plan B for Plan C, running down a list of who might be able to hook them up with what they need. Just as Eddie calls Dakota, the aspiring singer who used to supply him with drugs, Rome reaches into the bag and realizes that Kevin actually came through for them, leaving them to make the hardest decision of their lives.
Eddie consults his ex-wife Katherine (Grace Park), who comforts him by saying that Gary and Maggie expected this when they decided not to go to Mexico for the experimental drug trial. Katherine suggests to Eddie that "maybe the alternative is even worse" for Gary and acknowledges, "You are in an impossible situation."
Their son Theo (Tristan Byon) overhears the conversation and urges his dad to go through with giving Gary the drugs. "As difficult as it is, it's the most humane thing we can do," a wise young Theo says.
Maggie takes Gary on one last field trip to show him a Boston Bruins billboard that she had Katherine's wife Greta (Cameron Esposito) graffiti with "Gary was here." When they return home, Rome and Eddie show Maggie the video Gary made explaining Plan C.
"You're not doing this," Maggie says to Eddie and Rome after watching it. "I am doing it."
So Eddie and Rome leave for Katherine's house, where everyone gathered for dinner to share stories about Gary, while Maggie gives Gary a mug with the drugs in their bed. She tells him he'll be okay because "we have friends all around us" and says one last "I love you."
In a flash-forward, Maggie and Gary's son Javier, now 16, watch the video his dad made for him. Maggie takes Javier on a driving lesson and visits Gary's grave afterward to tell him she has a date with a dad at Javier's school coming up.
The Goldbergs Series Finale: A Bittersweet Ending with a Surprise Wedding and a Love Connection for Beverly
Javier celebrates his birthday with the whole gang, including Jon's daughter Sophie (Lizzy Greene), who is pregnant with Tyrell's (Adam Swain) baby. Then Javier and Tyrell go to a Bruins game with Theo and Jon's son Danny (Chance Hurstfield). They toast to "a band of dads" and snap a selfie.
Gary assures Javi in the video, "Even though I'm gone physically, I am still here. Our relationship, it isn't over — it just changes."