Your shoulder joint, or your glenohumeral joint, is controlled and moved by numerous muscles which are your deltoids, pec major, lats, rotator cuff, bicep brachii, tricep brachii, coracobrachialis and teres major. Some of those muscles will play a role in creating the movement that makes up the movement path of an overhead press. What we are concerned with though are the muscles that will help stabilize your "scapulothoracic joint" however.
I put that in quotation marks because it's not your typical joint consisting of two bones held together by ligaments. The scapula isn't connected to your ribcage by ligaments, but they interact so it's called a joint. In order to generate a decent amount of force in our glenohumeral joint we need to have our foundation that is our scapulothoracic joint to be held solid. What can make this complex is that we still need our scapula to move as our arm moves upward. Upward rotation of the scapula makes up one-third of the required movement needed to get our arm up overhead. We need to have stability throughout the entire movement path. The scapula typically wants to tip, or flair out to the sides, or people try to squeeze them together which prevents the upward rotation. We need a nice controlled upward rotation.
The starting point for this control starts with strengthening the middle back (i.e. middle trap and rhomboids) and external shoulder rotators (infraspinatus and teres minor). That combination of weakness and imbalance is a common pattern caused by postural distortions. We slouch, we constantly work with our hands out in front of us, and we care more about our bench press numbers than we do about how much we can row. That is where my first recommendation comes in, check-in with your row. Can you pull what you can push? There are recommendations out there that take it steps further and recommend that you can pull more than you can push, even well beyond 150% of what you can bench press. I'll leave that to you. My experience has shown that clients can pull a fraction of what they can push, so that's why I start there and ask you to do a quick check-in.
Next step is to strengthen the support muscles while introducing the movement. There are two ways you can do this. One way is the Prone Military Press- use a light enough weight that you can keep form- we want you to be able to keep your arms in line with your body, which means not allowing your arms to internally rotate and your humerus from horizontally abducting.
The other way is a banded military press with the resistance coming from the front. In this video I also add in an external rotation at the start.
Once you feel like you have good control of this movement you can progress to the next step which is adding some resistance in the actual press. Keep the weight light enough that you can still keep the control you felt in the earlier versions.
Everyone is going to need a different amount of time to progress so I can't give a good general recommendation on how long you should do this. Listen to your body and don't let your ego get the best of you. Do your sets until you feel like you did every rep with quality, not just until you can do 1 decent rep out of the set. Continue your pressing program so you don't lose ground, but add this in as a finisher or as a reminder to your system before you start your sets.
Good luck, I hope to hear about your new found gains and PR's!