Rest well, eat enough, don't push it when something is feeling a "little weird" with some muscle. My worst injury as a beginner 10+ years ago was to finish a deadlift routine after feeling a muscle slightly pulled after the first rep, I had a bad lower back pain for weeks that left me uncomfortable doing anything: laying down, sitting, walking, etc.
If you don't know any bodybuilders I'd recommend getting a good coach on your beginner phase to fix your form, you don't need to keep a coach after you learn the basics, and bad form is the #1 source of injuries at lowest levels. Starting Strength is a decent beginner routine but over time you'll want to add some auxiliary exercises to work smaller muscles, in my routine I like to start the training session with big lifts (deadlift, squat, standing barbell rows, chin ups/pull ups, bench press, and overhead presses) and after those I follow with auxiliary movements (face pulls, dumbbell presses/curls, calves, etc.).
I chose to not push myself past a level I got comfortable with, never tried a deadlift heavier than 220kg, my squats hover between 130-140kg, bench press around 80kg, military press around 55-60kg. I feel strong enough and been injury-free for years, it's a good maintenance level and my goal with lifting has always to just keep mobility in older age, not to keep growing muscles/strength as far as I could push.