The first step is to examine your combat log in detail. It will give you a breakdown of your attack roll bonuses. You need to increase your attack roll bonuses. How you do that is revealed in the Attack roll formula:
Attack Roll = Ability Modifier + Proficiency + Enchantment/Item Bonus + Class Features
Ability Modifier is the bonus from your characters main stat. For Barbarian it’s STR, Wizard INT, Warlock CHA etc.
Item bonus is derived from equipment. E.g a longsword+2 grants a +2 to attack rolls. Other equipment can also add attack roll bonuses.
Enchantment bonus will derive from a buff of some kind generated by using a spell, potion, scroll or an item that grantrs a spell like ability. E.g a cleric casting Bless will add +1 to the party’s attack rolls for 10m amongst other bonuses to defence etc.
Proficiency is something you get access to by virtue of your race or class. A weapon proficiency grants an attack roll and damage bonus to attacks with that specific weapon for example.
I/m not sure if there are any class features in BG3 that add to attack rolls other than Proficiencies.
So one way deal with low To Hit chances you look to every opportunity to get these bonuses.
The second way is to exploit the advantage/disadvantage system that is big in D&D 5e. If you can manipulate the situation so you have advantage then you get two attack rolls and take the better one. Which is huge. There are many ways to generate advantage.
For example if you are a Drow then you have superior dark vision (a race feature). If you can also cast Darkness then you can plunge your foes into darkness, effectively blinding them, but you can see in darkness perfectly well, thus you have the advantage on your attacks against them and furthermore they have disadvantage against you so when they attack you they have to make two attack rolls and take the worst of them.
This is not a simple game, it’s mechanically a lot more complex than XCOM. But that of course is why people love it so much.