When everyone is super, nobody is.
Are you, as a DM, at all good at optimization? If so, you can have some fun.
Most optimized 5e builds are good at certain things. By providing items that selectively improve PCs that aren't that optimal build, you can change the playing field.
The dirty little secret of 5e is that monster HP and damage and stuff is within the DM's perview. If players figure out a way to deal 10x damage, you can literally take the monster manual, and add a 0 to every monster's HP.
I don't recommend doing exactly that, but on the other hand I sort of do.
First things first, what level of optimization are we talking about?
# Gonzo
Gonzo optimization is anything from 3e batman wizard to pun-pun. This level of optimization completely changes the game. You can deal with gonzo optimization, but it means the game you are playing changes from "traditional" D&D to something else.
But it is more likely that you'll just veto someone playing pun-pun and becoming an overgod. And that is ok, that is an option.
# Smash
Smash optimization is where someone becomes capable of dealing relatively insane amounts of damage. In 5e, this can vary from a nuclear wizard build, to a pure class paladin in a 1 fight/day game, a hexblade assassin samurai paladin whispers bard surprise critboomer frankenbuild (and I know, that isn't viable), a XBE+SS fighter, or even the only player in your group that bothers with a 20 in their attack stat.
They are dealing more damage than 2 other players, or maybe the rest of the party put together, or maybe even twice that. It makes the cooperative component of D&D of "reduce enemy monster HP" irrelevant, because only that player (or players) matter.
This one is the easiest to deal with. Odds are that the player has one particular attack style -- magic missile, daily damage boost, ranged weapon or great weapon. In that case, simply provide magic items that don't synergize with that build that are stronger than ones that do synergize with that build.
As an example, I have a bardcher in a game. I randomly rolled a class, googled the strangest build for that class, and the one I found was unfortuentally overly effective; it did damage on par or higher than damage dealers in the party, and had bard utility to boot.
The fix was simple; weapons make the flametongue look like toys (paired set of +2 finesse weapon that deals 3d8 cold damage, requires 1 attunement slot). The bardcher has a good weapon (heavy crossbow +2 that deals +1d6 necrotic and has some fun riders), but the damage gap collapses.
Once you have that, you just need to have beefier monsters (HP wise or whatever), and the problem evaporates.
By providing some items that align with the optimizer's abilities, you give them toys to play with; by providing better items for other players, you reduce the gap.
# Indestructible
Another kind of optimization is being impossible to kill. This one is actually easier to deal with; you can just accept it.
Have monsters sometimes attack the impossible to kill PC, but not always. When they do, the PC gets to shine. When they don't, the puzzle becomes "how to get them to attack the PC that is impossible to kill".
Include debilitating effects that aren't what that PC is immune to sometimes occur. These can vary from "suffer a level of exhaustion on it", or "you get a death save when hit", or slowed, or anything else. Such effects level the playing field; don't use them always; the goal is that the "build work" made to make the PC indestructible is rewarded narratively, but isn't a constant trump card.
You can also boost the durability of non-indestructible PCs to make the playing field less ridiculous. I mean, suppose the problem is a bear-barian with high HP. Any level of damage you could do to threaten the bear-barian flattens everyone else on the first blow.
The bear-barian's edge is two fold; one, more HP, and two, resistance to everything (except psychic).
An example of spreading the durability, you can have:
Shield of Blocking: When you suffer damage, you can expend a reaction to get resistance to that damage.
Now, the big bad guy who hits for 100 damage per swing (in order to threaten the barbarian) can now sometimes swing at another PC; if it hits, that PC gets a 1 shot resistance. This isn't as good as the Bearbarians's "resist everything". The item isn't as useful for the Bearbarian, because resistance doesn't stack.
# Control
Battlefield control is another thing. Here, the PC shuts down creatures, from minions to a boss, through use of game mechanics.
One approach is to just throw more naughty word at them, ideally in waves and geographically separate. The control-PC then shuts down wave 1 (probably with a concentration spell), and wave 2 the rest of the PCs have to handle.
The control-PC gets to shine (great), and there rest of the party gets fun stuff to do (and feels that if they where absent, the control-PC would be screwed).
# Minionmancy
Honestly this is the hardest one here. While minionmancy is in theory based off of "more damage" and "more toughness" and "more control", the big problem with minionmancy is how much time it takes up at the table.
Fixing the damage/toughness and control elements of minionmancy doesn't fix the time problem. Here is a case where you may be forced to swing the nerf bat hard, just because controlling a dozen buffed-up sub-CR 1 monsters is a problem even if they didn't do anything at all.
An approach I'm considering in my next game is twofold. First, a limited stable of monsters; a given spell known only gives you (proficiency bonus) "true names" to summon; that reduces "search through MM" issues. Second, it is to systematically nerf the mass-summon spells creature count, while at the same time buffing the individual monsters. Because I can deal with a player summoning 1 beefy summon; that is just damage, toughness and control (see above). I can't deal with 20 of them, D&D mechanics aren't simple enough; and mass combat rules are still too clunky.
The spells that summon 1/2/4/8 creatures are changed to summon 1/2/3/4 creatures. They share an animating spirit, which means they have one shared mind (including concentration and dismissal). They get a built-in buff of "add caster's proficiency bonus to AC/ATK/Damage/DCs" (this makes the 4 sub-CR 1 monsters about as nasty as before, and the 1 count monsters tough). At higher levels, you add 8/5/4/3 HP per slot level (8*1, 5*2, 4*3 and 3*4 give roughly the same number of HP per slot level), and every 2/3/5/6 levels they get a (single) extra attack. (2/1 = 2, 3/2 = 1.5, 5/3 = 1.7 and 6/4 =1.5 gives roughly the same number of slot levels per extra attack; in theory CR 2 taps are harder than CR 1/0.5 and 0.25 taps).
Polar Bear as a 3rd level spell (level 5 PC) is then
AC 15, 42 HP, +10 ATK, 1d8+8 damage/2d6+8 damage
27.5 DPR (before, was 21.5 DPR, at -3 to hit)
As a 9th level spell (Level 17 PC) the polar bear becomes:
AC 18, 90 HP, +13 ATK, 1d8+11 damage/4* (2d6+11) damage
86.5 DPR (before, was 110 DPR, at -6 to hit)
A flying snake as a 3rd level spell (level 5 PC) is then
AC 17, 5 HP, +9 ATK, 4+7 poison damage (times 4)
44 DPR (before, was 64 DPR, at -3 to hit)
As a 9th level spell (Level 17 PC) the snakes become:
AC 20, 17 HP, +12 ATK, 2*(7+7 poison damage) (times 4)
112 DPR (before was 256 DPR, at -6 to hit)
but that is just detailed numbers. The point is that minionmancy (and certain kinds of optimization) can lead to table-time problems, and the above techniques don't help with that.
Back in 4e, this also occurred with "tap-mancy", where you made a character that attacked 10 times per round for buckets of dice each time, including 1-2 off-turn interrupts every round. The damage issue was separate from the "oh my god this takes too long to resolve" issue.