Short Version:
Maybe P is overwhelmed by bookkeeping and it's distracting him from situational awareness. Help him make a mechanically very simple character without fiddly bits or conditionals to keep track of, so he can focus on making good choices rather than having good bookkeeping. Invite the other players to support P with advice and by being good role models for the behaviour he's trying to cultivate.
Long form answer, with rambling and details.
Back in my very first RPG ever--and also my first time as a GM--I had a player whose poor choices got him repeatedly killed. Let's call him Q.
Q knew the rules and mechanics quite well, but had a very hard time applying them intelligently to whatever situation he found himself in (like forgetting to heal himself as a cleric). Even more than that, though, was his role-playing: he really really liked to role-play his characters, but that got him in trouble because when Q got deep into his character's internal motives the PC would lose common sense and perspective about the surrounding context of his actions.
It got bad. Really bad. Q's second character was killed by the party for betraying them (he had a conversation about his friends over tea with a "nice" lady). At that point I shared Making the Tough Decisions with the group. He studied it carefully, had intense discussions with me about it... and as a direct result his fourth character perished of untempered curiosity: the characterisation "very curious" overcame the common sense "half these items are cursed and my friends are begging me to stop," until the pile of treasure he was investigating yielded up a lethal curse.
After that session I took Q aside and we talked. He knew he had a problem, and he was trying to "get better," but he needed help. I'd noticed that all his PCs so far were mechanically complicated and required in-game bookkeeping: advanced casters and races with lots of conditional features and spell-like abilities to keep track of. So we hatched the simplest possible character build: nothing to keep track of. No "if you're flanking, X also happens," no spells, no per-day abilities. If his character sheet said he could do a thing, he could always do it.
We wound up with a kind of Indiana Jones flavoured skillmonkey (a rogue chassis with homebrew mods to replace things like sneak attack because tracking whether you can deal that extra damage was beyond what we wanted for the build). He wasn't optimised in the traditional sense--but since another PC in the party had straight levels in the NPC Expert class, that wasn't an issue in keeping him relevant in the group. Instead he was optimised for what Q needed: a simple no-bookkeeping character to let him focus on situational awareness and making good choices.
At the end of each session he'd hang back --along with any other players who wanted to-- and we'd reflect on the game: what worked, what didn't. We'd consult (and if necessary research) and come up with what to make sure we did again, and what we'd change next time. (I've since found that any game I run which has some form of this "reflect and plan" dynamic after every session is improved by it.)
In tandem with another player rising to the challenge and being a kind of "teach by example" role model, it worked. A year later Q was successfully running complicated wizard builds with great party dynamics and great depth of character. He was a real joy to work with, and all he needed was to wade in at the shallow end of the bookkeeping pool instead of jumping into the deepest part head-first.
nota bene: My players have tended to treat the group dynamic as one of table-level cooperation between friends. However much their characters may be rivals, at the table they collaborate to tell the best stories, and I'm also one of the collaborators. In groups where players and/or the GM act as rivals at the table level of things, I'm not sure how much my experience will be useful. It sounds like your whole group isn't really on the same page in terms of their desired gameplay experience, and communication isn't really strong. Working on improving the "friends at the table" level of things might help your game in a number of ways.
I recently just built a sand-box world for my players, and I have decided to handle the problem this way.
First: Same Page. I had a talk with all of my players individually and collectively detailing what sort of campaign I was building. I told them that they can do anything that they want to and go anywhere they want to go. They understand that they are impetus to the plot and they are all happy with this, so getting everyone on the same page was step one.
I would like my players to fully realise this is a big, breathing world that they can fully explore however they like.
I'm hoping to be able to let go of the main story and let them wander around the world, but I'm afraid they'll remain passive until I throw some encounters towards them, instead of them looking for adventure.
If your players realize from the beginning that they can self determine their course then they will feel less railroaded. Sometimes having a main plot at all will make the players feel obligated to follow it. Players can railroad themselves, so make sure they know that there are other options. Therefore getting all of the players on the same page will start the game off on the correct foot.
(First and a half: Know Thy Players. During the same page tool figure out what sort of game play your players enjoy: exploration, social interaction, combat, etc. and tailor your sessions to what the group has fun with.)
If you are worried about your players becoming stagnant without any input from you and you know what they enjoy then you can throw a few hooks at them. The hook doesn't have to lead to a story arc that you've already planned, but simply something to give the group a little energy.
Second: Player Buy In. Create NPCs and locations that the characters can "bond" with and the players grow attached to. For a sand-box feel throw in some opposing factions that they can work for or against, and let their actions have lasting consequences upon those factions, and the world.
The party is currently level 6, and I would prefer it most if they would gradually expand their influence over the world.
If you want your players to have influence in the world, then make sure your "...big, breathing world..." is just that: big and breathing. Give it life through its taverns, castles, NPCs, factions, atmosphere, smells, landmarks, environment, etc.
Third: Play. Be willing to say yes. When your player want to determine whether or not Annbann the Aristocrat killed his brother the Mayor of Woodale then let them do that. If they just want to kill him, because he's evil and that moves their story forward then so be it. Let them help you tell the story, and the story will compel them to keep telling it.
Fourth: Rebuild. As you play keep thorough notes of what your party does and how your players reacted to the game. Take what you've learned and grow your world, adding detail and definition to give the world depth in the areas that the players love exploring.
Best Answer
Firstly, the assumption you're making is well-meaning, but wrong: as DM you shouldn't feel like you can never “break character” to just speak as a person to the other people at the table. You're playing a game, and sometimes you need to pause playing and just talk about the game directly. It may seem counter-intuitive, but games work much better when you've all agreed to play together in the same way.
Avoiding avoiding the adventure
When players start doing things that will result in not going where the adventure is, or defeating the point of the adventure before it even starts, you have many options, enough that there's too many to really detail in one post. Some of those methods are in-world, and some of them are not.
In general, you want to choose a way that works and that is appropriate to your personal level of DMing skill. As a new DM, that means that the more subtle, clever ways are actually likely to be poorer choices, because they take experience to pull off successfully that you don't have yet.
A non-exhaustive list of methods:
Just tell the players. “Hey people, the adventure isn't that way. We could go that way if you want, but I have nothing prepared in that direction and I'd rather not be making things up on the fly.”
This is the easiest method, is very fast, and tends to be very effective, but it has no subtlety. Still, just talking about what's on your mind is often the right choice. What it lacks for subtlety it makes up for in speed, so it may actually be more fun than a more subtle in-world method, since it lets everyone quickly get back to the fun stuff you've prepared.
Let them do or go wherever they want, but move the adventure's start so that it's in front of them anyway.
This is very effective, and requires no out-of-game conversation. How simple or complex it is depends on the details of your adventure, since it's easier and more obvious how to move parts of some adventures and harder for other adventures. However, this method is also “politically” fragile for your group: if the players (not the PCs) realise that no matter what they do, what you want to happen will always happen (“railroading”), they can become unhappy at their lack of agency and unhappy with your game. On the other hand, some players prefer an entertaining story more than having choice, so it depends on your particular players.
(In online jargon this method is called the “quantum ogre” technique, and there is controversy over whether it's a good or bad idea.)
Just let them avoid the adventure, and improvise what happens next based on what makes sense for their actions and what would be fun to make happen. Save the adventure for later when they do go in that direction, or recycle its parts for a future adventure.
This method gives players maximum agency, but also requires skill at improvising from the DM, so it's not necessarily a “beginner DM” strategy. On the other hand, some DMs have natural talent at improvising, so it's worth considering. It requires no out-of-game conversation, but is not always as fun as running prepared material.
D&D in general has decent tools for improvising — when in doubt, you can always improvise an encounter with hostile monsters pulled right out of the Monster Manual, which will usually (though not always!) turn into a fight that will be fun and fill session time. Another favourite of mine is to have them run into a non-hostile NPC's home, where they can talk to someone who knows the area and have a bit of friendly roleplaying (though not always!).
(In RPG jargon this is sometimes called “sandboxing”, though some people use that term for only when the whole campaign is intentionally designed to let the PCs wander wherever they choose. A more general term is “improvisation” or “improv”. Many campaigns are almost entirely improvised!)
Let the players go where they want, but tell them that's what's happening. “The adventure I prepared for isn't this way, but you can go that way if you want. Just so long as you're all OK with me making things up that might not be as awesome, OK?”
This method gives players agency both in-game and out-of-game: they can make the choices that they want to make for their characters, and also the players themselves know that they're choosing improvised adventure over prepared adventure. They may even suggest that they would rather play the prepared adventure, in which case this method turns into method (1) above. Or they may be fine with improvised adventure, which turns this into method (3) except with player “buy-in” to an improvised session.
Make the PCs' lives difficult until they go the “right” way. This isn't actually a great idea, and is mostly included because you can do it, and it can seem like a good idea at the time, so it's worth mentioning its strengths and drawbacks.
In general, the only strength this method has is that you can avoid “breaking character” by talking about the game as people at a table. The downside of this method is that it's unlikely to actually work: the players are unlikely to notice that you're trying to change what they're doing, and even if they do notice that the game is being extra-hard, they're still unlikely to guess that it's a message. The players are more likely to just think you're being mean for no reason, get frustrated, and become unhappy with the game.
Set a fresh “hook” by using one or more of the PCs' personality or background details to attract them in the direction of the adventure. This can be an NPC related to them having information or being put in danger, an obvious clue that a villain they've met and personally hate is involved, or some other motivation that you know the players care about. The key here is that it's something the players care about and will want to see more of — it's the players who you're motivating, through their characters.
The advantage of this method is that it's entirely in-game, and because you're incorporating things that the players have created or contributed to the game, they will be more invested in seeking the adventure and in its results. Roleplaying is inherently collaborative, and there are few things more rewarding than seeing something you've created picked up and built upon by another person at the table — and that goes double for players, who often don't get to make those kinds of contributions. The downside here is that if this method is used too often it can become an obvious pattern, and some players will react negatively and it will stop working. On the other hand, if your adventures are normally woven out of many strands of the PCs' pesonality, background, and contacts, then it will just seem normal no matter how often it's used — but running that kind of campaign takes either experience or having a particular talent for orchestrating dramas of interpersonal relationships.
These are just a few general methods, not a complete list — there are as many more ways as there are DMs to think up ways to respond.
In summary
Don't worry so much about just talking about the game. A roleplaying game is not like a TV show or movie, where the audience never sees the actors out of character. In a roleplaying game you are both the actors, directors, and audience — and real actors and directors have to talk to each other out of character all the time in order to make the TV show/movie work. Same for you and your group: you will have to take short or long breaks to talk about the game, sometimes.
(Besides, if you set your heart on always being in-character, you will just set yourself up to be frustrated when your players break character! Speaking out of character to tell a joke about what's happening or to ask others if they want anything when they get up for more snacks is common and normal. Very, very few players make it a priority to stay in-character for the entire game session — few enough that you may never meet one.)
Focus instead on choosing a method that will be effective at continuing your evening of entertainment, and that will be simple enough to accomplish with your level of DMing skill. Avoid trying to do “fancy” DMing techniques right away — you need to learn to walk before you can run, and there are many, many basic things to learn and get skilled with when you're first starting to DM.
An aside about building the “perfect” world
Building worlds is like cooking: the first time you try to make a particular dish rarely turns out how you wanted it to — like cooking, good worldbuilding is the result of never-ending practice. Trying to make a big, amazing world the first time you build a world is like trying to make a fancy wedding cake the first time you ever bake anything.
To get practice, DM little games in little worlds — worlds just detailed enough for the adventure at hand. Make the worlds to serve their adventure purposes, and make them disposable so you can try ideas without needing to make a commitment forever to those ideas. Running a few short (1- to 6-session) campaigns in little worlds is an excellent way to get practical experience. The lessons learned from actually running games in actual worlds you've designed will teach you how to run games better, how to build worlds better, and how to recognise what kinds of world details are actually important for a world meant to be played in.