40 isn’t old, and you don’t need to do anything special because of your age. I’m 58 and hit the gym hard 4X/week. There are plenty of good programs on this site - just pick one in line with your goals and be consistent. Take care of those shoulders by learning how to bench properly. Most shoulder issues brought on by benching are due to poor form and/or lifting too heavy too often. Learn how to properly pack your shoulders for the bench - youtube videos will help.
maybe if you go 3x week and its been a while since you were lifting you could go for a full body split such as starting strength?
if your shoulders are an issue you could substitute bench press and overhead press with light dumbell press