When you DM, let your PC be an "NPC-by-committee."
I run a campaign where I occasionally let one of the players guest-DM a session they plan on their own, with me participating as a normal player. For this reason, every player in the campaign has their own PC, even me. That way regardless of the DM for the session everybody has a character they can play.
When someone is DM'ing, their PC is either handled as a suboptimal DM-controlled PC (follow the advice in Keith Curtis's answer for this technique) or as an "NPC-by-committee." When the character's turn comes around, they are not controlled by the DM. Instead, they are controlled by the rest of the players (typically by majority acclamation) or by whichever players are willing to take on the challenge of controlling an additional character (typically one or two players will be passionate about this opportunity and should be allowed to volunteer on a rotating basis).
This has worked exceptionally well in my campaign. Unlike a normal NPC that the players may not know very well or care much about, the "NPC-by-committee" is a regularly featured PC, so the players generally feel attached to that character and respect the emotional significance of that PC to the DM they belong to. This gets a lot of player buy-in because the players care for that character and take the responsibility seriously. Since the PC is a regular fixture in the game, the players are also fairly familiar with the character's abilities and competent at playing them effectively, whereas they might be less clear about the abilities of a normal NPC they don't often see in action.
I trust my players to take control of my character, and they haven't let me down. On the rare occasion that they suggest my character do something I believe to be out of character, I can redirect them to another course of action. If you trust your players to have control of your character, this technique works splendidly. If you don't trust them, then try the technique in the answer linked above, which has also worked well. Finally, follow the advice in the linked answer anyway to account for the dialog of the "NPC-by-committee," which should still be under your control.