Hector is first seen disguised in an attempt to go through the marigold bridge, even making up an accent to do so. However, this backfires when he is denied access to the bridge, and after revealing himself, Hector makes a run for it, but sinks through the marigold petals and is taken away by security guards.
Later, he is interrogated by a Corrections Officer for his actions, and unsuccessfully tries to convince him to take him across the bridge, and, as Miguel overhears, says he knows Ernesto De La Cruz and can get him tickets to Cruz's Sunrise Spectacular if he lets him across the bridge. Miguel asks Hector as he's walking out if he knows Cruz, and Hector is shocked to see that he's alive, before being pulled into a closet. Miguel explains that in order to get back to the Land Of The Living, he need's Cruz's blessing, while also saying the Cruz is his great-great grandfather. With this information, Hector says he and Miguel can help each other, but both up on the run from Miguel's ancestors.
After they are out of sight, Hector disguises Miguel like a skeleton to blend in. Hector says he can get Miguel to meet Cruz, but wants Miguel to put up his photo in the Land Of The Living in return. Hector wants to know if Miguel has any other family members that can get him home, but Miguel claims only Cruz can help him do so, and thus Hector joins him.
While they are walking and searching for Cruz, Miguel notices a sign for Ernesto's Sunrise Spectactular. Hector explains that every year, Ernesto puts on this show to celebrate the end of Dia de los Muertos. Miguel asks Hector if he can get them in to the Sunrise Spectacular, but he admits he can't and lied about being able to. However, Hector says he knows where Cruz is rehersing, and takes Miguel there.
Miguel and Hector arrive at the rehersal that Cruz is at, but find that he isn't there and is instead at a party. While searching for him, a group of performers notice Hector and tell Miguel the story of how Hector died by choking on a chorizo, though Hector claims he died of food poisoning. One of the performers tell the duo that neither of them will be able to enter Cruz's party without an invitation before telling them about a music competition, of which the winner will attend and perform at Cruz's party.
Hector and Miguel then make a stop at a small shantytown in order to retrieve a guitar. They enter a small house and find the owner of a guitar the pair need in order to win the competition. The owner, a skeleton named Chicarron, berates Hector for wishing to borrow his guitar despite Hector having previously borrowed a number of items from Chiccaron and failing to return them. Chiccaron then suddenly begins to pulse orange and become weak. He explains to Hector that nobody is remembering him, so he will soon suffer the Final Death. He gives the guitar to Hector under the condition that he use it to play one last song before his death. Hector honors Chiccaron's wishes and he peacefully passes at the end of the song. Hector then toasts to his forgotten friend before leaving with Miguel.
The duo then make their way to the competition. Miguel and Hector perform a duet, but soon after the performance, Miguel spots his family searching for him. Miguel panics and attempts to flee, but a suspicous Hector overhears that Miguel's family is looking for him. Hector scolds Miguel for lying to him about not having any other living family members, and attempts to expose Miguel to his family. Miguel responds by calling Hector hypocritical by using him to further his own agenda before escaping.
Miguel manages to get to Ernesto's party by sneaking in with a band that had competed against him in the competition. Following close behind, Hector manages to sneak in by using the same disguise and accent he used when he tried to pass the bridge. Hector then confronts Cruz and Miguel, revealing to the latter that Cruz stole his songs. Despite his anger, Hector simply wants to make amends and send Miguel home so he can place a photo of Hector up, allowing him to cross the bridge. Hector tells the story of the night he died: Cruz wanted to continue working with Hector, but Hector became homesick and wanted to go home to his family. Ernesto then told him he would "move heaven and earth" for him before sharing a shot of tequila. Later, when they are walking down the street, Hector chokes and passes out on the street. Miguel realizes that the exact same quote appears in one of Ernesto's film's where Cruz is poisoned with a shot of tequila. Hector then realizes that he was poisoned by Cruz by the drink he gave him that night, and attempts to fight him, but is taken away by a security team. Cruz then orders Miguel be taken away, fearing that if he returns to the living world he would ruin Cruz's reputation.
Miguel is thrown into a pit and finds Hector is already inside. Hector reveals the reason he wanted to cross the bridge was to see his daughter, whom he never got to see again when he attempted to start a music career with Cruz. Saying his daughter's name Coco aloud, Miguel takes out a photo of her at a young age Imelda and a man whom he thought was Ernesto. He then asks Hector if the man, whose face in the photo was torn off years ago, is him. Hector says yes, and Miguel realizes that Hector is his great-great-grandfather. Hector then sadly explains that he won't be able to see Coco, even in the spirit world as she is the last person to remember him, thus if she dies he will suffer the Final Death as she enters the Land of the Dead. Miguel, now knowing his true heritage, then exclaims he is proud to be related to Hector. The duo begin to cheer, and as they do Dante arrives followed by Imelda. The group then returns to the train station roof where Imelda scolds Hector for putting Miguel in danger. Miguel then explains that he is responsible for the pair being stuck and Hector had simply been trying to help. Hector explains that all he wants is to visit Coco. Miguel explains to Imelda that she doesn't have to forgive Hector for leaving her and Coco years ago, but that he's still family. With this, Imelda decides to help Hector.
The group then plan to take Hector's photo back from Ernesto by sneaking in during the opening sequence of the Sunrise Spectacular. While backstage, Imelda runs into Cruz before slapping him for "murdering the love of [her] life." Cruz then attempts to flee and while chasing him Hector asks Imelda about "what you said back there", though Imelda simply states she doesn't know what she said. The entire Rivera family fights with Ernesto's security team, and in the midst of the chaos Imelda manages to get the photo, but is knocked onto a elevating platform, which rises her to the stage. Hector and Miguel both run to the side of the stage and urge a stagefrighted Imelda to sing. She does so and dances to avoid Ernesto and his security team. After stepping on Cruz's foot and running off stage, Imelda and Hector hug each other before complimenting each other's musical talent.
The pair prepare to send Miguel home and allow him to play music, but before he can touch the petal, Cruz grabs Miguel and threatens the family. Tia Rosita and Tia Victoria both secretly turn on a camera and record Cruz threatning the family and admitting to murdering Hector and stealing his songs. Cruz throws Miguel off a balcony to his death, but Imelda's spirit guide Pepita saves Miguel. The entire family celebrates as Cruz goes on stage before being booed and carried off by Pepita. In a humorous twist of fate, Pepita throws Cruz onto a bell, which falls and crushes him. Hector, however, begins fading as the sun rises as Coco slowly forgets about him. Miguel, having lost Hector's photo, promises to not let Coco forget him as Imelda sends him home.
Miguel returns home and attempts to remind Coco of Hector by showing her the family photo of her, Imelda, and Hector, but she doesn't respond. His family enters the room he's in and demands that he explain his actions. Abuelita then demands Miguel apologize to Coco, and he does so by tearfully playing Remember Me to Coco. She slowly sings along and smiles, explaining that her Papa used to sing it for her every night. Coco then reaches into her nightstand and opens a notebook that contains all the poems and letters that Hector wrote her, many of them containing lyrics to his songs, providing proof to the Land of the Living of Cruz stealing Hector's songs. She also reveals the missing piece of the picture showing Hector, Imelda, and a young Coco together. Coco then begins to tell stories of Hector to her family, thus saving him.
A year later, Hector's guitar and lyrics to his songs are proudly on display at the Rivera household for the rest of the Land of the Living to see, while the completed photo of him, Imelda, and Coco is displayed on the Rivera family's Ofrenda table.
In the Land Of The Dead, Hector enters customs preparing to enter the Land of the Living, and for the first time, is granted access thanks to his family photo being taped up. He happily reunites with Imelda, having rekindled their relationship, and Coco, who now resides in the Land of the Dead. The three then begin to cross the marigold bridge along with the rest of the Rivera family. Hector is seen at the Rivera party dancing with Imelda before grabbing a guitar and playing alongside Miguel.