I watch a lot of youtube and listen to a lot of people on a regular basis talk about their opinions on D&D, what to do, what not to do, and how to handle certain things. A popular topic is NPCs, how to make them work and particularly how to handle them if they're as powerful or more powerful than the PCs.
The consensus seems to be the same across the board; NPCs that are more powerful than the PCs should exist. That makes sense for a breathing world. They shouldn't just drop everything to help the PCs at a moment's notice, but they should be there.
And then they get to talking about DMPCs and another general consensus pops up; just fucking don't. And I disagree with this by a pretty wide margin. So while there are a lot of people saying "just don't ever do this it always ends bad", I'm going to try to take it from another angle and actually attempt to advise how to do this properly.
I'm used to playing in hot seat campaigns where everybody gets a turn in the DM seat. It's my favorite way to play, it doesn't leave me stuck DMing all the time but if I want to the option is there, and it's just generally fun to see what kind of world you and all the other players create together when you have free reign to mold the world equally. This does not work for every gaming group and that's okay, but if it does and you want to try it I highly recommend it.
Except in a game like that DMPCs are pretty much required. Which is part of why I think it's so weird that everyone seems so against DMPCs as a construct. But because of this I have a long standing history with running DMPCs and being in a party with other people's DMPCs and I feel like I have a pretty decent perspective to talk about how to make this work.
I think the most important thing to remember is that when you are DMing you are a DM first and a player second. If you need to have your character on the backburner that's fine, and in fact it's pretty inevitable. You want the party to be doing things like solving puzzles and talking to NPCs for the most part. Your DMPC is another person for the party to talk to, you want to make that fun for them without stealing too much spotlight.
Another big piece of advice I have is not to try to do it if you have more than five players. I know a few people that can manage a big group, but I'm not one; most of the DMs I know aren't. So that's very likely to be a clusterfuck of a disaster, just make sure you can run the party before you try to throw in a character to be with them all the time.
DMPCs are a unique animal.
You can't play them as straight up PCs. They are never going to have an organic reaction to the plot because you already know what's going to happen and you're going to need to focus on what you're running for other players. Your DMPC cannot be authentically surprised because you will not be authentically surprised by your own work.
However, you also can't play them as an ordinary NPC either because they are always with the party and taking an equal part in the combat with an equal stake in the outcome of the campaign. While with most NPCs they aren't going to give a damn if your heroes fail or succeed, your DMPC will.
My two cents is to try and play them from a support angle. Focus on what your DMPC thinks of the other player characters rather than just on who the DMPC is as a person. Everybody likes to hear about themselves. Even if your DMPC doesn't like all the other party members, they will be interested in hearing why, possibly in the bickering that comes from it and very likely in mending whatever is broken between them and this other character. It's a great opportunity for character development on both sides.
Give them a solid flaw to remind the players that this is another character and not you. If you need an excuse for them to be shite at solving puzzles or talking to people, a low Int or Cha score is a good way to do that on paper and either could manifest itself in a lot of interesting ways.
Maybe he just isn't great at critical thinking under pressure.
Maybe she's kind of gruff and every time she has to talk to another NPC she seriously botches it.
Maybe he's afraid of the dark.
Maybe she's in super big debt from gambling and syndicate members show up once in a while to try and beat the crap out of her.
Maybe he is just straight up racist against dragonborn or tieflings, and that brings up another conflict point for the PCs to resolve whenever one comes on screen. Whatever is bad about this character, keep it consistent. In my experience, D&D players really like being able to meddle in other people's lives and help fix their problems.
Try to look at them like a companion in a video game and give them a companion quest to solve. The more instrumental the other PCs are in that, the better. Everybody wants to save somebody, particularly their travelling companions. The more they do to help the NPC the more patient they are going to be with things like them getting the last hit on their own big bad guy. Think about your favorite companion quest in a video game you've played. Don't do exactly that, but do think about what you liked about it and what about it worked for you, pick it apart until you have the pieces, then reassemble them for your DMPC.
I also advise having a home base for your companion characters, to park them when the PCs don't want them along. I know it's not heartening to hear this but sometimes the PCs just won't want the DMPC with them and that is okay. If they decide they want to leave them behind or if you need to, having a town the PCs keep coming back to and a place to park them that the PCs will know where they are is hella handy.
Consider what the party doesn't already have. 100% do not double book them. If there is already a rogue don't roll a rogue. Do something the party is lacking. My group, for example, never wants to roll a healer so my DMPCs often end up being clerics who stand back and heal or buff the rest of the party. For this, a bard is also a solid choice, or even a wizard with the right spells.
Don't just pay attention to what they have mechanically, either. If the party is full of jokesters try giving them a straight man to play off of. Got a party with Spongebob and Patrick? It's made that much better if your DMPC is a Squidward. Alternatively if they're all super serious edgelords, throw in a prankster.
Mostly, just pay attention to who this character is primarily in relation to the other PCs. Make it 90% about them first and foremost and once you've touched on something specific and meaningful for each PC, you can do one thing for your DMPC. But always be super conscious about that. Err on the side of favoring the PCs every single time and if they decide they don't want to travel with your character, that's okay.
Also don't try to hide that this character is your character they're going to see right through that from a mile away. Be honest with them, your players will respect that.
I actually wanted to get into some anecdotes of DMPCs I've seen done right, but I just realized how long this journal has gotten so perhaps another time.