How come they are together?
It’s as simple as shown in movies: she found the loophole- "sacrificing their time together". This means that even later in life, she will still remember those five years and the sacrifice she made, while he will not. This also confirmed when Yu Xuan met her at her bakery, he didn't remember her, while she remembered everything; it’s similar to how Shu Yan didn't remember the first two reversals. The theme was never about sacrificing each other or only one could live; rather, if they want to save someone, it will cost them something, so are they willing to take that risk? She understood that and came up with the loophole of letting go of Yu Xuan and never finding him.

So how come he went to the bakery?
NOTICE THE DATE when that exact thing happened, it was Jan 1st 2023. When January 1, 2023, arrived, it marked a new day (new beginning) for both of them; cause together they never moved past December 31, 2022.
As before that. Yu Xuan's wish kept them stuck on the same day, while Shu Yan's wish took them five years back. So when the new year came, they effectively skipped their doomsday, as it was not that one of them would die the next day or later just because they survived that particular day. The movie shows that their doomsday was supposed to happen on that "particular" day. (It's not as if they will never die, but for now, they have made it past the doomsday, somewhat akin to what happens in "Lovely Runner" or "Perfect Marriage Revenge.")

Just like their older version said, what is destined to happen will happen. They were destined to meet, but one of them was destined to die on December 31, 2022. Which, due to Shu Yan's wish, they actively skipped, and since she wished upon the candle that she never met him. The fate considered that sacrifice and made sure that they didn't meet at the time being.

Now, the interesting detail I noticed that made Shu Yan's wish make more sense was the time Yu Xuan woke up after every reversal.
He always woke up 15 minutes earlier than the last one, so originally it was 9:30, then it went to 9:15 and 9:00. Regardless of this, the same things happened, but what changed was the time of death for Shu Yan.
So, rather than Yu Xuan waking up earlier and having more time with her, Shu Yan kept dying 15 minutes earlier than the original timeline; that was the only change in each reversal. Making a point that time can be traded in if they want to make that wish.

Because with every reversal, the only thing that changed was time, as every key moment of that day kept happening the same way.
Her falling, them almost crashing on a green light, the button falling, him finding out about the author, her mom finding her career change, and then the accident.

Hinting viewer that time was the only aspect that was changing and can work as a possible trade-in, but are they willing to make that choice? She somehow was able to make that sacrifice because Yu Xuan didn't. He would rather choose her to stay alive. (True to his character, cause in times of adversity, he always chose her to stay out of it, exactly like their relationship.)


(How I know Shu Yan died earlier with the first reversal at 9:15. Yu Xuan wanted to rush out of the police station to save Shu Yan; he remembered her original time of death. However, he was notified about the accident that had happened earlier and was surprised to hear that. Not only that, the first responder also made a point with each other, she died 15 minutes ago when they were at the accident scene.)