A good part of any RPG session revolves around character actions, asking questions like "a goblin jumps out of a bush with a sword, what do you do?". However, what might be overlooked at times is that there is more to character actions than just what they are literally doing, often it's more important to ask the players what do they want to accomplish, as well as why are their characters doing something?
In general, any action would focus on "A character does an Action because they want to achieve an Outcome in service of their Goal or Belief". An Action is what the character does - "I punch him". An Outcome is what the character wants to accomplish - "I want to intimidate this guard into running away by punching him". Their Goal or Belief should be guiding their actions - "I need to get to the palace to do X, therefore I will intimidate this guard into running away by punching him".
The problem arises when there is a disconnect between these parts. When a pacifist gets the case of a goblin brain and decides to kill someone for no reason, when the characters get too caught up in the turn-to-turn action and lose sight of why they are doing something, or when a desired Outcome is not communicated clearly and say, instead of rolling to intimidate with punching you break out the combat rules to track individual HP, the session can start suffering for it.
In a good deal of older games, it's up to the GM and the players to figure these things out and call for rolls appropriately.
There are some games that focus on the Outcomes more explicitly, such as Burning Wheel or Mouse Guard, where both sides in each conflict have to explicitly state what they want to achieve if they win. Similarly, many Powered by the Apocalypse games like Fellowship codify actions into Moves that provide the players with outcomes that can guide them into choosing the correct Action to take.
Few games that I've come across seem to focus on asking the characters "why do you do it?". Often they come up in a form of characters having explicit beliefs that should be invoked and challenged regularly, such as in the case of Burning Wheel or Star Trek Adventures. These either give mechanical advantage to a roll, or give the character XP for reflecting on them after they are challenged in pursue of their immediate goals.
You will also often see the difference between Action and Outcome focus when comparing lighter systems with something more crunchy. Comparing Exalted with Fellowship for example, in the former you can attempt to dodge or parry an attack, while in the latter you would Overcome it, aka avoid the damage by whatever narrative means you need. Similarly, in Exalted you can try hurting someone with Brawl, Archery, Melee, or even Athletics, while in Fellowship you would just Finish Them with Blood to kill them. The former focuses on the Actions, while the latter - on Outcomes - "I don't want to be hurt", "I want to hurt them".
While often things are very simple - "I want to kill the goblin, because the goblin wants to kill me and they are what stands between me and the loot" - when things get muddled it's often good to pause and make sure everyone is on the right page before going deeper into the weeds.
If you are a GM and the players seem to go off the rails in some weird way, maybe it's time to ask them those magical questions - "What do you do? What do you want to accomplish? Why do you do it?". It can help players ground themselves and explain their logic so that the adventure can resume with everyone knowing what's going on.