It's been a long-lasting debate in this fandom on whether Ymir's sacrifice made sense or not, and I'd like to convince you that it did.
Being an AOT fan, you should know not to take things at face value. Just because Ymir says she's selfish doesn't mean that she is, and I'd like to argue that she actually might be the most selfless person in the show. Ymir acts like she only cares about Historia when she actually cares so much about the people around her.
Throughout the show, Ymir displays countless acts of selflessness and a tendency to sacrifice herself. Let's dive into them:
• As a nameless street orphan picked up by a cult, she was groomed and used as a false goddess by adults who wanted power. Yet the moment Marleyan authorities raided them, Ymir lied and took full responsibility to protect the same people who exploited her, which ended up costing her 60 years.
• After getting her second chance at life, she joined the Cadet Corps anyway just because she thought she and Historia were similar. I got the impression that she wanted to teach her how to live a life she's proud of, and not repeat the same mistakes Ymir did.
• Ymir transformed on that snowy mountain back in the training days to save Daz, a nobody, when it would've cost her everything.. even though this was done primarily so Historia would stop trying to be a martyr.
• At Utgard Castle, Ymir could've transformed and saved her own skin (or even taken Historia with her), but she stayed back and fought for her friends, knowing she wasn't guaranteed survival. We can also see that she was very hesitant to use the castle to defend herself because she worried the people up there would get harmed.
• Ultimately, Ymir went with Bertholdt and Reiner because she could empathize with their situation and recognized their desperation. She knew what would happen to them if they returned empty-handed with two missing Titans. Ymir also recognized the "debt" that she owed them, having eaten Marcel.
"But she left Historia behind.." she realized that Historia had a chance of surviving inside the walls, and that taking her to Marley would only put her in danger.
HM: trying to cover up the truth from Connie by mocking him and cracking jokes.
I noticed that Ymir and Historia were opposites: while Ymir used selfishness as a shield to hide her selfless nature, Historia did the opposite. Ymir wanted Historia to live for herself because she knew she was incapable of ever doing it herself.
So, going with Bertholdt and Reiner was the most Ymir thing to do ever, actually.