I assume you have some kind of synergy in mind?
At 12th
Aaracrocka BM Fighter. +2 Dex, Sharpshooter, Feytouched (Hunters Mark +1 Wis), Resilient (wisdom). Gear +2 Longbow and Bracers of Archery provided by the Artificer. (Dump Int, Str, Cha, Max Dex, Wis, Con).
Maneuvers of note are Precise, Menacing, Pushing, Ambush and Maneuvering attack.
Spells cast at the start of the battle, Longstrider (from the Artificer), Flame Arrows (ditto) and Hunters Mark (personally).
Vuman Battle Smith artificer. +2 Int, +2 Int, Sharpshooter, Fighting initiatiate (Archery). Gear +1 Repeating Musket (infusion), (Dump Str, Cha, Decent Wis, Con and Dex, Int 18 (used for the Bow).
Spells of note are Longstrider (cast on everyone), Flame arrows (on the Ranger), Dispel magic (prepared) and maybe more.
And the Steel Guardian, which has Longstrider cast on it, Warding Bond cast on the Artifcer via a Spell storing Item, and wearing Winged Boots (artificer infusion).
It basically goes
They win initiative (a near certainty for the Fighter at +5 (+1d10), 50/50 for the Artificer).
Fighters turn. He
Hunters Marks Vecna (he's not casting a spell, its already cast, he's just shifting it to a new target) as a bonus action, toggles SS 'on' and unloads 6 times at +7 (dealing 1d8+1d6+1d6+18). Any attacks that miss, he spams precise shot to flip them into hits. Any attacks that hit, he spams Maneuvering strike (and the Steel Guardian or Artificer get to fly 35' as a reaction), adding +1d10 to the damage.
Just under all 6 should hit, but over 5. We can assume 5 hits (its in Vecnas favor) with 3 of them hitting with Maneuvering attack (rolling at least a 9), and 2 with the aid of precise (adding +5.5 to the attack).
With average damage on each hit, its 160 points of damage.
If Vecna moves behind a pillar with his teleport reaction, I have 70' of fly speed to find him. Otherwise I move to a position as far away from Vecna and the Artificer as possible.
Artificer repeats the above, at +7 to hit, with 2 attacks from his Gun ignoring cover (and a 40' base move ignoring cover, plus he's already moved 20' as a reaction) each hit doing 1d12+16.
Will probably only get one hit, but with some luck gets two hits, dealing 45 damage, plus also spamming an extra 2d6 Force damage for another 52 damage. I then finish my move to be on the other side of the Fighter, and as far away as possible (so no AoE).
Next goes the Steel Guardian. It's already moved 25' and now moves another 50', flying as well. It attacks at +9 and if it hits, deals 1d8+4+2d6 force damage (15.5).
With just a tiny bit of luck, I've dealt 230 odd points of damage.
Vecna likely teleports away (healing) and Dominates the Fighter. I get a Wisdom save (+8 at Advantage) to resist. If that occurs, the Artificer Dispells it, moving behind total cover of the pillars first so as not to get countered.
After that we get into a war of attrition we likely cant win (dealing around 80 damage per round, which he can heal).
It all comes down to
'Can Vecna use his healing ability, targeting himself for damage, and then healing because he dealt damage to himself with it'. If the answer is 'No' we can pretty easily kite him (Keeping the Steel Guardian at range, and having it shoot him as well) with movement speeds of 70' and starting the battle spread out, and we drop him on round 2 (or maybe 3).
If he can target himself with that ability, then we have a problem.
He does have a pretty impressive range with that teleport and heal, if he takes the Dash action though. 150' plus a 15' radius mini damage burst, and then healing 80. Keeping out of that range is all but impossible I guess.
We likely cant do enough damage, while he slowly whittles us down with piddling teleport and reaction damage, healing what we deal.
It would take a bit of luck on round 1 really (a crit or two)