You have to be careful in Baldur’s Gate 3 when attempting to move in combat. While in close range, an attacker can perform an opportunity attack against any of your characters if they are within proximity and try to move away. This typically happens if a melee fighter moves in on an archer or a spellcaster, typically vulnerable to close-quarters fighting. To avoid being attacked by an opportunity attack, your characters must disengage and move away, and it’s a specific action.
It uses a bonus action to disengage from a target, and you find it on the toolbar next to your other actions. It is represented by an icon where an individual is jumping. You usually want to perform this action if an enemy who can do a melee attack is within two and a half meters of your character. Typically, when you go to make a movement action, enemies can perform an attack of opportunity against you light up as red.
After clicking the jump/disengage bonus action, your character will have a short distance to travel to remove themselves from any attacks of opportunity. Once safe, your character can continue their movement or perform any other action they wish to do. A strategy you may want to do is attack a target, disengage, and then move away. It’s a simple hit-and-run scene, or you may want to disengage, reposition your archer, and then attack from the point of advantage.
It’s up to you on how you wish to proceed. But also make sure your weaker characters are not in danger of being attacked. The further from harm they are, the more damage they can do with spells and carefully timed attacks.