Shoulder injuries seem to occur more frequently than many realise, I think.

Easily done for those that lift weights - risky exercises being things like press behind neck, and chins / lat-pulldowns behind the neck. So if you do any weights, don't do those variations, and actually as a generalism, if you lift weights don't press behind the neck, or do pulldowns behind the neck - and be very careful with upright rows.

I've had some shoulder issues for some time, and whenever I heard it being discussed, I always heard people talking about a book called the 7 minute rotator cuff solution. Well it's rarer than hen's teeth these days, so I bought a book from Amazon:-

Treat Your Own Rotator Cuff: Amazon.co.uk: Jim Johnson: Books

Which I found pretty good at educating about the shoulder, plus help in understanding and remediating problems.

I'd also echo the other comments in the thread - often shoulder problems can be due to an imbalance in the shoulder area - more often than not, the front part of the shoulder is stronger and more developed than the rear - perhaps as a result of many who train, favouring pressing movements to pulling / rowing movements. That is also a worthy consideration for shoulder health.