It varies a lot depending on the rules of your game, but you can often get a useful starting point by asking "how much is this unit going to accomplish over its entire lifetime?"

This can usually be broken down into:

1. What is this unit going to do each turn?2. How many turns before this unit dies?

For instance, suppose you just have 2 units attack each other every turn until one of them dies. #1 is probably proportional to the unit's attack (that's how much it does each turn), and if you're receiving damage at a consistent rate then #2 is probably proportional to the unit's effective hit points (the total amount of damage it would take to destroy it). If you multiply those together (damage per turn * turns you'll survive), whichever unit has the higher result will probably win.

Of course, if your game was really that simple, people probably wouldn't play it.

At minimum, you probably need to take into account targeting rules for group fights (can my high-HP unit take hits for my low-HP unit? can all my units gang up on one enemy unit to kill it faster?).

You may need to worry about:

action denial (you could have attacked for 20 this turn, but none of my guys were in range, so you spent the whole turn moving and lost your attack chance)

granularity/"overkill" (you can attack for 20, but none of my guys have more than 2 HP, so 18 of that is wasted)

healing/regeneration (you could have killed this guy with 20 damage, but you only managed to do 18, and then I had time to recover to full health so that 18 damage ended up being wasted)