One way to avoid injuries is by stretching and warming up before you play difficult music. Musicians are fine-motor skill athletes, and just as athletes must warm-up, we need to as well. Develop a routine of warm-ups and stretches to help you get ready to play your instrument comfortably (you can find some suggestions here). I also work with my students to find good ways for them to warm-up during practice or before rehearsals and performances. Give yourself and your students time to build up to practicing the most difficult passages and techniques on your instrument.
While warm-up routines might vary depending on your instrument, all musicians need to develop and maintain good posture. I try to stay hyper-aware of my posture, since I know that slouching or poor posture contributed to the constant back pain I suffered a few years ago. Now, I'm careful to keep my posture relaxed and up right, and I teach my students to do the same. I've started to research Alexander technique for tips in keeping a comfortable, balanced posture while standing and sitting. It can also help to stay aware of the tension levels in your hands or your body while you play. Many of my students have raised shoulders or tight hands, and over time this constant body tension can lead to injuries. I find that students have a freer, more beautiful sound when they spend time releasing the unnecessary tension in their hands or shoulders, and those techniques also prevent injury.
Many musicians have to carry heavy instruments, music bags, stands, and other things to and from rehearsals. Now, I try to carry only what I'm comfortable lifting. There's no point in injuring yourself to prove a point, and it's fine to make multiple trips or ask for help if you need it!
Last, it's important that musicians take care of their overall health. It's hard to eat healthy or exercise when you have a demanding career that often involves tons of travel, yet maintaining a healthy body prevents injuries and helps us play better. There's tons of studies that show sitting for a long period is unhealthy, so if you can stand up and play, spend some of your practice time standing instead of sitting. Otherwise, go for a short walk after you've practiced for an hour. It's important to take breaks during long car trips or intense practice sessions to stretch your legs. And if you do get an injury, make sure you see a doctor and rest long enough to fully recover before you start playing again!