How do you deal during play with a player who makes things miserable for the others when he or she is not actively in the spotlight? Such miserable-making activities include frequently doing things in-game purely for the sake of attention that take time away from the other players, disengaging at the table when not actively at the center of things and needing others to catch him or her up on what has happened, drawing out anything that involves his or her character, and attempting to justify the attention grabbing by making bold, impulsive decisions in-game, steering the story in unwanted directions.
Last fall I ran a Pathfinder campaign that fell apart in large part because of one of the players demanding a disproportionate share of the attention and who would get bored and restless when not at the center of the action. The player did not realize the problem and truly wanted to be a part of the group; he simply lacked the self-awareness to correct his behavior on his own. I tried working with the player one-on-one outside of the game to no avail before eventually asking him to leave. It was understandably hard for some players to put the bad start behind them and the group disintegrated soon thereafter.
I am considering starting a new group in the near future and want to make sure that I do not repeat what happened last time if I get stuck in a similar situation
Well, there's no silver bullet solution. This isn't really an RPG problem, it's a pure-play interpersonal/psychological issue, variously called 'spotlight hog,' 'attention whore,' 'attention seeker,' et al. I'll call it "attention seeking," the more canonical term, going forward. In general especially for adults, "telling them to quit it and booting them if they don't" is largely the solution, which you did, but it does have side effects. What you - and importantly, the rest of the players - can do is to in general promote good behavior at the table (they can't leave it to you). Then, the solutions tend to be found in general work/parenting/etc. social discussions, like:
This article on mitigating attention-seeking behavior is targeted at small children, but frankly it's about as good as with adults, as this is at its core a "you didn't listen to the lessons about taking turns in kindergarten" problem.
A lot of the other articles on this tend to be fairly negative about the possibility of addressing this successfully in a group. This Psychology Today article closely links it with causing drama and pretty much says "yeah, that's hardwired." Even articles like this one about problem personalities at work say "just avoid them, don't try to confront/fix" because of how easily it just spirals into drama.
What it all boils down to is that all you can do is:
I've dealt with attention seekers in both games and real life, and sadly that's all you can do and it'll only work about 50% of the time, the rest of the time you have to deal with it (work, family) or cut them off (friends, gaming).