In case you couldn't tell, I'm obsessed with the Armorer.
While I have a tendency to really focus on tank-like RPG characters, I love the fact that next to the fantastic tanking capabilities of the Armorer's Guardian mode is the capable ranged damage dealer Infiltrator mode.
Most builds I've explored tend to favor one armor mode over the other. I think you can build a really tough-to-kill tank with Guardian mode, and I think you can abuse your 15th level advantage to get a lot out of an Infiltrator/Sharpshooter.
But with this post, I want to consider how one could build a versatile armorer - one who could excel in both a tanking and ranged damage mode.
So, let's talk about parameters.
First off, I'm avoiding any multiclassing builds. I'm sure there are good arguments to be made for picking up a few levels of Fighter, for instance (maybe going Eldritch Knight to get Shield along with Action Surge and other nice goodies). For me, though, I want to assume you find the Soul of Artifice feature at level 20 compelling enough to go all in on the class. This also reduces some of the insanity given the vast number of options that open up with multiclassing.
So, with that set aside, what choices to we really have to make?
Artificers can prepare different spells on each long rest, so we don't really need to talk about what you're taking for spells other than cantrips. (We do get to change one of these out each time we level, but I'm going to include them as that's a finite number of chances to change them - though as a DM I'd certainly allow swapping cantrips when you get enough XP at level 20 for an Epic Boon).
The next choice is infusions. All Artificers are a bit infusion-dependent - it is the central mechanic of the class, after all - but Armorers in particular get ways to buff multiple parts of their armor, making this extra important.
Finally, we can look at some Feats that could complement both playstyles. Naturally, you'll need to consider where you can afford these feats as opposed to Ability Score Improvements. Any Artificer will want to maximize their Intelligence, and Guardian mode does really favor getting a high Constitution.
I suppose race choice here is also a factor, though thanks to the changes to racial ability score bonuses in Tasha's, you're going to be far more flexible.
So, let's start:
Cantrips:
One of the real sacrifices you'll need to make if you want to be versatile with this subclass is that the SCAG melee cantrips - particularly Booming Blade and Green-Flame Blade - only work for Guardian mode. Infiltrator mode uses a ranged weapon, the Lightning Launcher, and thus means that these cantrips become dead weight if you're in that mode.
In either mode, we only have one weapon that uses our Intelligence modifier - Battle-Smiths can have a sword and a gun, and as long as both are infused (or inherently magical,) they're equally capable with both. But Armorers only have the one ideal weapon at a time. For that reason, I recommend grabbing a cantrip that uses a saving throw - when in Guardian Mode, it gives you a ranged option, and when in Infiltrator mode, you have a melee option (since your ranged attacks would be at disadvantage in melee range.)
With this in mind, my favorite options here are Acid Splash and Frostbite. The former has the potential to hit two targets, and does a type of damage that few things have resistance or immunity to. Frostbite has the same range, but requires a Constitution saving throw and only hits one target, doing cold damage, but the bonus effect is quite potent - giving the target disadvantage on its next attack roll. While I think tougher, high-level enemies will likely have strong Constitution saving throw bonuses, this could potentially make it easier to slip away from a foe that gets into melee with you in Infiltrator mode, or help you protect your party against a ranged attacker in Guardian mode.
Naturally, though, I think utility cantrips make a ton of sense for a martial artificer. While Alchemists and Artillerists need to have some damage cantrips, you're far less reliant on these, so you could even skip them entirely (at least after you hit level 3).
Thematically, Mending makes a ton of sense, even if you don't need it quite as much as you might as a Battle Smith or Artillerist. That said, if you wind up taking the Homunculus Servant infusion, you'll be able to use this to patch up your little buddy outside of combat, so it's a good option.
Then, as usual, things like Guidance, Mage Hand, Message, and Prestidigitation are always good to have around.
Infusions:
I will say that there are a lot of infusions that work really well for Guardian Mode and fewer that have a big effect on Infiltrator Mode. Given that your Lightning Launcher doesn't require ammunition, there's no reason to take Repeating Shot over Enhanced Weapon, so just grab that and it'll work for both the Thunder Gauntlets and the Lightning Launcher.
I do think Guardian Mode is going to want Enhanced Defense and Repulsion Shield, as well as Cloak of Protection and Ring of Protection. While none of these make your Infiltrator any better at shooting things from afar, it will have the nice bonus of making it really hard for anything to hit you, even if you're less likely to be taking damage given your range.
Here's something I'd like to see clarification on (or a DM's ruling). Can you wear robes under your armor? The Mind Sharpener is pretty cool - letting you auto-save on Concentration saves (and even letting you see if you'd succeed anyway first) a few times a day. Given that Artificers have proficiency in Con saves already, this might be overkill, but I think it's a strong infusion nonetheless - if we put Haste up on an ally (or ourselves) it'll be very good to not worry about dropping concentration on it.
Resistant Armor is another I'd consider for Guardian mode, if you're in the sort of campaign where you might get some hints as to what you're going to face in the coming days. While a Guardian will probably just want Enhanced Defense on by default, if you're about to fight a red dragon, it might be worth it to drop your AC in order to get fire resistance. Again, possibly less potent for an Infiltrator, but given that elemental damage often comes in ranged or area attacks, it might actually be better than simply boosting your AC.
Goggles of Night will be an obvious choice for any artificer who doesn't inherently have darkvision.
Now, Boots of Elvenkind are probably redundant if you're in Infiltrator Mode. Cloak of Elvenkind actually has an added effect - creatures have disadvantage on their perception checks to spot you (this, by the way, also means a -5 penalty to their passive Perception,) so this could potentially help a bit, though part of its effect is redundant for Infiltrators.
Winged Boots I think are an obvious one - as long as you don't use them constantly, you'll basically have a fly speed in every combat encounter. This will allow you to stay out of range of scary melee combatants if you're in Infiltrator Mode and it'll let you chase down flying foes in Guardian Mode.
Homunculus Servant is also potentially a strong option. It effectively gives you a construct familiar that can deal a little modest force damage. While Artillerists and Battle-Smiths will want to conserve their bonus action to use their Eldritch Cannons and Steel Defenders, respectively, as an Armorer you'll often have a free bonus action (Guardians will often want to reactivate their Defensive Matrix, but that is unlikely to be every turn). The homunculus can fly and also has a very respectable perception bonus - so you could use it to compensate if yours isn't that good.
Belt of Hill Giant Strength is actually something I'd consider looking at as well - this raises your Strength to 21. While you don't need high strength to move unimpeded in heavy armor thanks to your subclass features, this will allow you to carry more things (I think worn armor does count against your carrying capacity) and will also aid with things like Strength saves and Athletics checks. Getting another stat to +5 almost for free is pretty good, honestly. This can also potentially help you diversify your weapon options. While the Thunder Gauntlets' "taunt" effect is, I think, enough to make it an obvious go-to even if you can't ever quite push it to a +3, this will make it easier to fend for yourself in Infiltrator mode or simply be able to use cool weapons even in Guardian mode (though only simple ones). Your Extra Attack feature doesn't require that those attacks be the built-in ones, after all.
I might also look at Cloak of the Bat. Given that your Lightning Launcher can be in the chestpiece of your armor, that means you should be able to use it without using your hands - this means you can use the cloak's abilities to fly - though again, the advantage on Stealth checks is redundant in Infiltrator mode.
Feats:
Now, some of the obvious good feats like Sharpshooter run into the problem of not being useful for both modes. While we can be a little more liberal with infusions, given that we learn 12, ultimately, and can infuse 8 of them into our gear, it's unlikely we'll have more than one or two feats.
Let's get Lucky out of the way. It's good.
Next, I think Alert is a strong option. Given that our role is either to play the tank or the damage-dealer, we're going to want to go early in the combat and start to control the battlefield in various ways. Being able to drop a Faerie Fire on a group of enemies in round 1 can make the battle much easier. Alert is a good feat for just about every class and build, but I think it's particularly well-suited for our roles. This also means you'll never be surprised if you're not incapacitated, and you creatures can't get advantage on you just because you can't see them. Again, being able to act as soon as possible is very nice - the fact that we can don our arcane armor as an action also means that even if we're sleeping out of the armor to recover hit dice, we can very swiftly get into the action - potentially even before the ambushers get to attack us while we're unarmored.
Now, for a bit of a deeper cut: Medium Armor Master. This is stat-dependent - you'll need to have at least 16 Dexterity to take full advantage of it. If you're unfamiliar, this allows you to add up to +3, rather than just +2, of your Dexterity modifier to your AC while wearing medium armor. It also removes any disadvantage on Stealth checks while wearing medium armor. If you can swing a +3 to Dexterity, this effectively turns Half-Plate into quiet Plate. Thus, you get the maximum AC you'd get from wearing heavy armor, but now if you're in Infiltrator mode, you genuinely have advantage on stealth checks, rather than just a flat roll. Whether you can actually get your Dexterity that high while also trying to get good Intelligence and Constitution is a big question, especially if you're giving up an ASI for a feat (unless you're a variant human). This does make the proficiency in heavy armor you get with the subclass redundant, but if you can swing it, this can be a very nice feat.
Tough will get your HP to nearly Barbarian levels, but again, doesn't do much for Infiltrator mode (though of course everyone likes having more HP).
Fey Touched is a popular option for a lot of classes. This gives you Misty Step and any 1st level spell of the Divination or Enchantment school, both of which you can cast for free once a day, though you also get to use your spell slots on them. This could give you some stalwarts like Bless, or you could grab Hex or Hunter's Mark to buff your damage. This also boosts one of your mental stats by 1, so if you start off with an odd Int score, this is practically a freebie (assuming you don't have another stat that's odd that you want to raise.)
Ultimately, splitting your focus between both of these armor modes is going to make it a little harder to excel in every way that you could. But I think you're not going to be sacrificing a ton. That said, I imagine that most parties will figure out which mode they need more - if you've got a Barbarian and a sword-and-board paladin, you might find you tend to stay in Infiltrator Mode more often. On the other hand, if your party is all Wizards and Sorcerers, you'll probably be finding yourself going Guardian most of the time.
As such, if you get to play in a consistent group, you might decide that the Versatile build isn't worth the sacrifices. But again, I think you're going to be, like 95% as effective as if you had specialized one way or another, and while D&D does reward specialization, it also rewards creativity, and the flexibility you get here might let you roll with the punches in surprising and fantastic ways.