You would calculate the resistance to each damage separately. The modifier should also have a damage type, and you would include it with the dice roll for calculating resistance.
For example, with a melee weapon like a greataxe where you apply your strength to its slashing damage you would calculate \$(1{\rm d}12 + \text{Str Mod})\div2\;\$ (rounding down) slashing damage. And then calculate \$1{\rm d}6 \div 2\$ (also rounding down) fire damage.
So your final formula would be:
$$\left\lfloor \frac{1{\rm d}12 + \text{Str Mod}}{2} \right\rfloor + \left\lfloor \frac{1{\rm d}6}{2} \right\rfloor$$
(Those lines on the sides being the floor/round down symbols.)
RAW would probably be as described in this answer. They reference:
Damage Resistance: If a creature or an object has resistance to a damage type, damage of that type is halved against it.
Damage Vulnerability: If a creature or an object has vulnerability to a damage type, damage of that type is doubled against it.
Resistance and then vulnerability are applied after
all other modifiers to damage. For example, a creature has resistance to bludgeoning damage and is hit by an attack that deals 25 bludgeoning damage. The creature is also within a magical aura that reduces all damage by 5. The 25 damage is first reduced by 5 and then halved, so the creature takes 10 damage.
(D&D 5e SRD, Pg 97)