When you do certain things like push ups, dips, or bench press, there is a lot of pressure on the structures at front of the shoulder. This includes the biceps tendon, shoulder capsule, acromioclavicular joint, the end of the collarbone (clavicle) itself, and the rotator cuff tendons. This is ok, and safe, and your body can get used to it in most cases (people with significant instability and history of dislocations may need more targeted advice). But this may take time, and during that time, you may feel pain.
There may be reasons why your shoulder may be moving more than normal in the socket, causing it to put more pressure on these structures. This may happen if you have slightly stretchier ligaments (hyper mobility), slightly less strength or stiffness in the muscles, a history of repetitive micro trauma which stretches out the joint (e.g. gymnastics, bowling, pitching, swimming), or even just are born with a slightly different shaped bone structure that means the joint moves a bit more than in other people.
You may notice your shoulder crunches or clicks a lot if this is the case, which in itself is not dangerous, or harmful, it just means that the shoulder is moving around within the socket and causing these sounds. None of this is necessarily a problem. It may just mean a little more focus on improving the stability of the joint is required, to reduce the amount of movement of the ball on the socket with movement.
What does this mean? 2 things.
One: Gradually get your shoulder used to pressing in the direction that is painful (horizontal pressing): bench press, chest press, push ups.
How?
Start with horizontal pressing movements that
don’t hurt. This may involve reducing the range in some way, so doing a push up halfway down only, doing a bench press to a block. It may also involve reducing the load, so doing push ups from the knees, or doing bench press with a lighter weight.
People are often hesitant to do this, but it is ONLY TEMPORARY, and it is better than pushing through and never getting better, or stopping all together and resting!
You may also need to reduce how much of these you are doing, for example, only do these movements twice per week, and relatively low sets, perhaps 2 exercises, 3 sets of 10-12 each, twice a week. So a total of 12 sets of reduced load/range horizontal pressing movements per week to begin with (as a suggestion).
Two: Keep your shoulder strong by doing other shoulder exercises.
You will be able to find positions and movements that don't hurt. Back exercises or pulling exercises such as rows, lat pulldowns etc often feel fine. You may also find that overhead press feels ok, but only on a certain angle.
Note: not to be taken in place of professional healthcare or medical advice.