One thing that I have not seen mentioned is that, if someone is optimizing to hyper-focus on one thing, they are going to leave themselves vulnerable elsewhere. GMs can take advantage and split the group. Put the character(s) in situations where the group is either split up by external forces or, to succeed, has to split up into smaller groups or as individuals. Then, place characters in situations for which they are not optimized, but still have some chance of success.
I am this type a DM. And I do love breaking Optimizers and send them crying from the game.
But to back up a bit.....
I do love optimization, and I'm an optimizer myself. Though as a Forever DM I am a homebrew optimizer: To be clear I don't play the silly Magic Card sub game of "who has better game master using the official rules". I make my own homebrew far outside the rules.
But when it comes to players, who are locked into the official rules, I put optimization as part of the three pillars of play: optimization, teamwork and intelligence. Nearly all typical optimizers are only optimizing to fuel their ego and be jerks. This type of player does not do well in my game.
First of all I role play a lot....that "acting" type role play. Sure the optimizaer can have their character do 100d100 damage, but ask them to speak in character that they just sit there like a blithering idiot.
And more so, the character will often encounter things that are not combat. So doing 100d100 damage does not help with anything other then combat, and again the poor player will be lost.
And second, the more extreme one, combat in my game is hard. Most foes try to kill the PCs every single round of combat. And foes hide, climb trees, and use all sorts of basic tactics. Plus most of my adventure game world has dangerous terrain....to the extreme. Optimizers don't fare well here.....their character will take damage and die, leaving the poor player shocked. And even a simple flying foe will leave them beyond flustered.
But, this is where the other two pillars come in: teamwork and intelligence. Teamwork gives you access to other things you don't have, and intelligence gives you to skill to use your optimized character correctly.
A fun one from just last weekend.....The PCs get attacked by some wererats in the sewers. And the wererats only attack twice...then run. Optimized players hate this and charge right after fleeing foes. The wererats head down a tunnel with an Ur classic 'section of floor where they scurry across at rat size'. The optimizers are just saying "I"m super duper" and run right into this false floor trap....fall 30 feet onto poisioned spikes in acid with acidborn sharks. And they die quick enough.
Of course, intelligence here would have told them not to run after wererats and to be careful of such traps and even tell them about the whole 'rat size' trap trigger. Teamwork with the other character could have detected the trap and been prepared for the obvious fall trap by roping each other together.