Shimano's brifters that route the cables under the bar tape make the gear cable turn through a tight corner to get into that routing. This seems to weaken the cables and, if they're not replaced in time, they invariably snap there, leaving a frayed stub of cable stuck in the shifter mechanism. How on Earth do you get it out?
Use the small lever as if you were moving to the small chain ring or smallest rear cog. This unwinds the cable as far as possible, though it might not have a huge effect depending on how frayed the stub is.
Then, traditional advice is to start poking around with tweezers, needle-nose pliers and anything else that's small enough to get into the little hole the cable feeds into. If you can grab the frayed end with pliers and pull firmly (not hard) on it while you use the small lever, that might help it unwind more. You're trying to get it into a position where you can see the cable's end block, so you can push it out.
However, don't try that for more than a minute or two. Replace the rubber cover on the hood and then peel it off from the front, like this (sorry, didn't think to take photos until I'd already replaced the cable):
On the underside of the hood, close to where it meets the bar, there is a screw ('scuse my big ol' thumb):
Undo that screw and you can remove a cover from over the shifter mechanism (this is why you need to peel the rubber cover off in the opposite way to usual). That will give you full access to the shifter mechanism and you can usually remove the cable stub in seconds.
Thanks to YouTube user cycling stuff for this technique.
Comments under the video say that it won't work for Ultegra 6600, but that's nearly 15 years old, now.