What happened in the final episode of Amnesia? I watched the last episode of Amnesia about 3 times but I still can't understand what it is talking about.

Can someone explain it in a simpler way?
It has been a while since I watched it so forgive me if this is not entirely accurate, but here is a general idea:

At the start of the episode we have realised that Ukyo has a split personality between wanting to protect Heroine by letting himself die or kill Heroine in order for him to live.

It was either in this episode or the one before that it was revealed that Ukyo was being transported between dimensions by the spirit king (or equivalent individual, I can't remember their name anyway) but was no longer able to do so, hence Ukyo had to decide if Heroine in this dimension will live or die with Ukyo having the opposite fate.

In the end Ukyo either stabbed himself or didn't kill Heroine in time (I think she had to be killed by a certain time as her original fate was being killed due to an explosion), she was then saved from the building by aforementioned spirit king who explain the whole situation and transported her back to her original dimension, in which she gets to choose to be with based on whichever door/card she chooses.

I hope that helps, if I'm still missing something let me know.