The word dharma gets thrown around like it means one thing. It does not. The Mahabharata is essentially an argument about which dharma wins when three different ones collide in the same room.
There are at least 3 layers of dharma, and almost every difficult decision in your life is the result of these three disagreeing with each other inside the same person.
SvaDharma is your personal dharma. The code you have signed up to as a particular person, with particular vows, roles, and loyalties. Karna lived and died for svadharma. He knew Duryodhana was on the wrong side of the war. He fought anyway, because the loyalty he owed the man who took him in was the dharma he had chosen for himself. Bhishma did the same with his vow to the throne. Personal code, followed to the end, no matter what it costs.
Samanya Dharma is the general dharma of the time. The shared moral code of a society. The rules everyone has agreed to live by. Yudhishthira was its purest follower. He would not lie, he would not deviate. He gambled away his wife in the name of keeping his word, and what followed was because he could not see any rule above the rules. A magnificent human being who repeatedly led his family into catastrophe by refusing to update his definition of right.
Sanatana Dharma is the eternal one. The dharma underneath the dharmas. Krishna operated from this layer. He told Yudhishthira to mislead Drona about Ashwathama. He had Bhima break the rule about hitting below the belt. He counselled outcomes that no honest player on either side would call clean. Read from Svadharma, he is a rule-breaker. Read from Samanya Dharma he is dishonest. Read from the Sanatana Dharma, he is the only one on the field who actually sees the war.
BG 4.8: paritrāṇāya sādhūnāṁ vināśāya ca duṣkṛtām, dharma-saṁsthāpanārthāya sambhavāmi yuge yuge. For the protection of the good, the destruction of the harmful, and the establishment of dharma, I appear in every age.
Notice the word Krishna uses. Dharma. The deeper order that all rules, vows, and codes are supposed to be serving in the first place.
The painful decisions you have made come from this argument running inside your own head. You honoured your svadharma and broke a social rule. You followed the rule and felt your personal code crack. You reached for what felt eternally right and watched both the rule book and your own ego call you a hypocrite.
Bhishma and Karna were loyal. Yudhishthira was honest. All three lost. Krishna chose the layer none of them could see, and history remembers him as the only one who understood what the war was actually about.
The question to ask yourself the next time these three voices fight in your head is which one is actually speaking. Your personal code, the rules of the room, or the deeper order both of them are trying to serve.