Star Trek II: The Wrath of Khan is a movie about consequences.
Heroes usually have the luxury of avoiding consequences, as they go from episode to episode always succeeding. Star Trek II is quite explicitly about how Kirk has avoided consequences for his entire life, starting with him beating the Kobayashi Maru scenario at Starfleet Academy.
David: Lieutenant Saavik was right: You never have faced death.
Kirk: No, not like this. I haven’t faced death. I’ve cheated death. I’ve tricked my way out of death and – patted myself on the back for my ingenuity.
In Star Trek II the consequences all come at once, whether it is a long-forgotten enemy or a son.
And in the end, the ultimate consequence, the death of Spock.
Which, in usual Heroic fashion, turns out to be reversible in Star Trek III: The Search for Spock.
James T. Kirk: [Looking up from the planet surface to see the remains of the Enterprise burning in the atmosphere] My God, Bones, what have I done?
Leonard McCoy: What you had to do, what you always do. Turned death into a fighting chance to live.
And Star Trek II and Star Trek III are about the dialogue between the needs of the many and the needs of the few, or the one.
Sarek: But at what cost? Your ship. Your son.
James T. Kirk: If I hadn’t tried, the cost would have been my soul.
Infinity War Part 1 is definitely also about consequences, as I have written in Infinity War Part 1 – a universe out of balance. Presumably Infinity War Part 2 will be about the search to undo what has been done in Part 1.
I have to say that Star Trek II & III are rather more elegantly and clearly about these philosophical questions and about the consequences of a lifetime of heroic actions, but these ideas nevertheless are in Infinity War and (presumably) will emerge in Part 2 as well.