Full story
The 2012 Loki, who escaped with the Tesseract during the time heist in Avengers: Endgame, lands in the desert and is instantly arrested by the TVA, the Time Variance Authority. The TVA guards the Sacred Timeline, set up by the mysterious Time-Keepers, and erases any deviation. Before Judge Ravonna Renslayer, Loki only avoids being wiped because Agent Mobius wants him as a consultant. In an archive he watches his own future, including his death at Thanos's hands, and something in him shifts.
The mission is to hunt another Loki variant who's been killing TVA agents and hiding inside apocalypses, where nothing she does leaves a trace. Loki and Mobius figure out she's stealing reset charges. When they find her, the variant is a woman who doesn't want to be called Loki: her name is Sylvie. She scatters charges across the timeline, creates dozens of branches and escapes through a portal, pulling Loki with her.
The two end up on Lamentis-1, a moon about to be destroyed in 2077. With the TemPad dead, they have to work together. Sylvie reveals that every TVA agent is a variant with their memory wiped, people who once lived normal lives. As the planet ends around them, Loki and Sylvie form a bond, and it creates an event so big the TVA finds them. Mobius learns the truth about the agents and is pruned by Renslayer. Loki is pruned too, in front of the Time-Keepers. Sylvie beheads one of them and discovers they're robots.
Loki isn't dead. He wakes up in the Void, where everything the TVA erases ends up, and meets other versions of himself: Classic Loki, Kid Loki, Boastful Loki and Alligator Loki. Sylvie gets there too, and together they enchant Alioth, the cloud that devours everything, opening a path to a citadel beyond time. Mobius returns to the TVA ready to tear it down.
At the Citadel at the End of Time, He Who Remains is waiting. He created the TVA to contain a war between versions of himself spread across the multiverse. He offers a choice: take his place, or kill him and set every timeline loose. Loki hesitates, and Sylvie kills He Who Remains. The Sacred Timeline branches out of control. Loki gets back to the TVA, but Mobius doesn't recognize him and the statue where the Time-Keepers stood now shows He Who Remains. That comes back later.

