As for your question, there's a lot to unpack.
There's high level play, and there's D&D.
For GMing powerful PCs, these tips might be of help to you:
https://www.roleplayingtips.com/rptn/rpt119-19-tips-gming-powerful-characters/
.For GMing D&D 5E Tier 3 and 4 PCs, well, first of all please understand the game at that point is stacked against the GM.
Not only does the action economy heavily favour the players characters from level 1 onward, but it gets exacerbated once characters start getting into more powerful abilities.
I call D&D 5E Super Hero Fantasy. That's how it feels to me as a genre.
Spellcasters as high level in 5E outclass all other characters - by a long shot. There was a reason Gygax made wizards weak at low levels. Their battlefield control and area damage effect spells pretty much whack your NPCs and monsters before the warriors can close.
So, relatively speaking, you're now dealing with a mixed tier group in terms of capabilities. The other characters are there now just to prevent the wizards from losing concentration.
Practically speaking:
- Change the campaign type from dungeon crawls. It's about Save the World now, not save the village.
- Add Factions, intrigue, politics, and any other type of roleplay. Roleplay challenges stump PCs of any level.
- Sharpen your Story Crucibles with Constraints and Conflicts from your Setting. Mechanics won't challenge your PCs as much any more.
- Think about using 5 Room Dungeons more often. Quick build-ups to epic conflict encounters. High level player is less about whacking guards and minor obstacles now.
- Add Legendary Resistance to key foes.
- Outthink the PCs. Make Choices have steeper Costs. You can double your IQ by getting help here with specific plot or encounter questions.
- Ensure key encounters have spellcasters.
- Add layered foe types to key encounters (Brutes, Artillery, Strikers, etc.).
- Apply 5E Conditions more often. They allow you to soften the PCs up a bit for when the serious saving throws are needed.
- Use Mission style plots and combats. It's easier for your foes to foil a mission than to kill the characters.
Hope this helps!