what's the word for when you don't resist doing something you don't want to do?
What's it called when you unenthusiastically do something that you have reservations about. You might consciously resist participating in something because you're ethically opposed to it or because it conflicts with your personal ideals. But in the end you submit either because you're compelled by duty or obligation, you realize your ideals aren't pragmatic, or your method keeps failing, or you realize you were wrong. Whatever the reason, you might not be happy about it and you might not want to admit it, or maybe you're simply being forced. But in the end you relinquish control or subdue your inclination to resist, and you cooperate or comply.
An example is, you might be a passionate, publicly outspoken opponent of euthanasia for many years; adamant that your way is the best and only way until a day comes that you have to watch as someone dear to you suffers.
Another example is, you might be in the military, and your commanding officer gives you an order to do something that you disagree with but you decide to just grit your teeth and do as you're told.
It's a word that I learned only recently, and I have used it in context before, but have forgotten. I believe it's a verb. Actually, I recall there being two similar, but distinctly etymologically separate words that both can be used to basically mean the same thing.
I am not sure all your examples describe the same thing. In any case:
acquiesce
Accept something reluctantly but without protest.
might fit your description.
You may also consider:
resign
2 (resign oneself to) Accept that something undesirable cannot be avoided.
'she resigned herself to a lengthy session'
'he seems resigned to a shortened career'2.1 archaic Surrender oneself to another's guidance.
'he vows to resign himself to her direction'
If you do something you don't like, don't agree with, or have reservations about (but out of some sense of duty or necessity), you do it grudgingly.
From Merriam-Webster's definitions of grudging:
1 : UNWILLING, RELUCTANT
// a grudging supporter of the reform movement
// a grudging admirer
2 : done, given, or allowed unwillingly, reluctantly, or sparingly
// grudging compliance// Her theories have begun to win grudging acceptance in the scientific community.
// He has earned the grudging admiration of his rivals.
// Of the sons, only Kayce, the one who left (and who at some point became a war hero) has earned his father’s grudging respect, and Kayce wants no part of it.
— Ellen Gray, Philly.com, "With Kevin Costner in 'Yellowstone,' Paramount Network finds home on the range," 15 June 2018
In your examples, the opponent of euthanasia would grudgingly watch their friend end their life after suffering (you don't actually say this, but it's implied), or the soldier would grudgingly follow the orders of their superior officer.
As a verb, you might capitulate:
[Merriam-Webster]
2 a : to surrender often after negotiation of terms
// The enemy was forced to capitulate unconditionally.
b : to cease resisting : ACQUIESCE
The company capitulated to the labor union to avoid a strike.