i can't think about this for long otherwise i'll genuinely cry.
when yuuji and megumi meet, megumi sees him get possessed by sukuna while trying to carry out the wish of his only family (to their knowledge) that had been alive till recently. this is also what yuuji sees when megumi gets possessed.
they both choose the same thing for the other, to save them.
megumi's reasoning is that he doesn't want to see a good person die, he chooses who he wants to save. in the middle school flashback, we see his reluctance or uncertainty in saving anyone at all. though he only knew yuuji for less than a day, he bends his own rules to save yuuji's life.
when they first met, yuuji wanted everyone to have a natural and justified death, so to speak. but by the end, yuuji seems to have a fuller perspective. i could write a thousand paragraphs about that and buddhism motifs and whatnot, but i'm sticking to my initial thought for now. yuuji values all life, but he admits he is ready to let megumi go if that is what megumi truly wishes. he bends his own rules and tries to be content with megumi's choices, though not without mentioning his importance to yuuji.
megumi, who believes he has no purpose after hurting so many people, even the people closest to him. megumi, who is blaming himself for actions caused by the spirit of another, who denies anymore convincing because he is sure he is unsalvagable. megumi, who sees no worth in himself or life after all the pain he's caused. remind you of someone? oh yes, i'm alluding to post-shibuya incident yuuji. that was when yuuji felt these exact things, when he believed he hurt the girl who was akin to a sister for him, and the man who tried his best to guide and protect him. that is almost EXACTLY what megumi went through with tsumiki and gojo.
they are quite literally the only ones who can understand each other, and yet they bend their rules for each other whenever they can to understand the other to an even greater extent. they lose and gain things throughout the story, but the story both starts and ends with them absolutely refusing to lose the other.
megumi and yuuji do what gojo and geto couldn't (sorry), they refuse to lose the other for any reason. they are stubborn AS FUCK. i say this because,
1, when yuuji tries to isolate after shibuya, megumi rushes to find him and convince him otherwise
2, when yuuji still does not agree, megumi does not let his pride get in the way of asking for help, which is unusual due to how closed off he is (as opposed to the kfc scene where gojo lets geto walk away)
3, during shinjuku, when yuuji sees megumi resisting his efforts to try and save his soul, he slowly learns to respect megumi's wishes instead of stressing his own principles and beliefs
4, after the chaos geto causes, gojo had to kill geto for the greater good (allegedly), and only said loving words (also allegedly) while geto was on the brink of death. neither gojo or geto see each other's perspective in this situation, though their bond is undeniable. on the other hand, yuuji never even considers letting megumi die in exchange for a more effective way to kill sukuna, for the "greater good". however, when megumi himself says that he's had enough, yuuji believes in him and stays content with whatever choice he makes, though not without expressing how lonely he would be without him. after hearing this though, megumi also allows himself to see yuuji's perspective, and ends up deciding to live.
i could go on and on and on. but i'll leave it here.
TLDR; while acting as each other's saviors and bending their own principles for the other, they also give purpose to each other as well as the story. and to me and my rant of course.