Shoulders are notoriously problematic and easily injured, so making sure that you are keeping them safe when doing presses is essential. The safest way to do a shoulder press is to use a cage to lift in and to set the safety rails at the proper height. If you lack access to a lifting cage, a smith machine can provide the same safety, although it restricts your movement which makes the exercise easier and less dynamic. If you lack both of these things, try working with a friend or asking someone in the gym to be your spotter. Lastly, increase weight slowly making sure you can control it on the way down.