A good place to start is this question and its answers, even though, somewhat surprisingly, "How to do this," is not explicitly called out as a question. This will still give you a good cross-section of opinion on what the thing is that you're being asked to do.
I can share my personal experiences of how I run a Session 0, though, as well as address your specific concern about player knowledge and optimization.
What I do is going to sound very simplistic: I get all the players together, ideally in the same environment (or one of the environments) that we're going to use to actually play. Right now that means someone's home with a nice big table to gather around. Back in the day, it meant the gaming shop where we could use a table, or a student center area when I was in college.
Then I describe in very high level terms the kind of game I am interested in running, and ask if the players are interested in that kind of game. This often starts out as something similar to a discussion of genre:
- Sure, we're all good with a science fiction oriented game. I want to run something like space opera, is everyone good with that?
- No, a few people want cyberpunk? Well, can I incorporate some of those elements in the game-- will that be enough?
- Okay, is this space opera like Star Wars (high tech and pseudo magic) or space opera like The Expanse (lower tech and no magic, but [spoiler spoiler spoiler])? I was thinking the latter....
You can see this moves from the very general to more and more specific. It can also cover things like the tone of the game (Is player-vs-player a given? Is it taboo? How dark is this setting going to be?) and so forth.
It's really not a part of the game directly, it is a conversation, it is social preparation for the game, to make sure everyone is interested in the game and everyone comes prepared for the game that you're actually going to run. I cannot give you hard rules on how to resolve conflicts during a session 0, though, except a vague sense that since the GM is doing more work than anyone else he probably ought to get more concessions than anyone else. Other than that, this is social negotiation not unlike deciding on sushi vs pizza: It is highly dependent on the people involved.
As far as too much player knowledge goes, in my experience this is mostly a non-issue.
First, the point of the session 0 is not "tell the players what happens," but more along the lines of "tell the players what to expect." The precise genre of game you're running isn't (or shouldn't, in my opinion) be considered a spoiler.
Second, character-optimizing players will always exist, but this is fine. There are other ways to shut down optimizing players, and in the last recourse, you as GM are the one setting the challenge level of the campaign.
Consider another extended example: Imagine you have told your players you are going to run a 5e D&D game. Your unannounced concept for the game involves a background of goblin, hobgoblin and bugbear tribes unifying under the rule of Maglubiyet's priests, gathering other humanoid armies and eventually invading the "civilized" lands. In short, a very military, martial kind of a game with a lesser focus on enemy clerics.
If you keep this concept to yourself, you run a real risk of getting players designing characters with concepts and skills that are superfluous-- social movers, squishy sneak thieves, etc.
If you announce this, you're more likely to get a ranger who is, yes, in some sense optimized against goblin-kind. But that character also thematically fits the game, and may have backstory that explains why he is optimized against goblins. Or, alternately, if you have a player who is really set on being a social manipulator, you may at your discretion be able to insert some story lines and scenarios into the game which make that player shine.
Put another way, I'd much rather have a character optimized for my game and who fits well into the background, than to have a character optimized for situations that will only rarely occur. The second character is useless, and since optimizers gonna optimize, I prefer to co-opt them from the start.
(But note, even here you don't have to give away your entire campaign idea. You can keep it as simple as, "Lots of fighting with an initial focus on humanoid monsters.")