The bench press is a very popular exercise to strengthen the upper body, but it is often done with poor technique. You can improve your performance and protect your shoulder joint with solid technique. The video, below, shows the technique that I use and recommend. Always use a spotter when bench pressing (I am using a power rack with spotter bars at chest level to protect me).
If you have any shoulder problems (or pain through any portion), the bench press may not be the best exercise choice. A modified version or another exercise may be a better choice. You may need to work on shoulder mobility and stability before working on the bench press for optimal results and joint safety.