Stretching is just one small piece of a pretty big puzzle.
There's lots of different ways to stretch, and lots of different reasons for stretching, so a black and white answer is a tough one. For example you can stretch purely for therapeutic reasons. The stretching in this case isn't supposed to make much of a difference to anything other than how you feel. It can really help you relax.
A lot of people do stretch to try and increase flexibility. However, quite often they stretch muscles which aren't restricting them in the first place, and even more often they aren't stretching in a way that will make much difference to anything, for example, a few 30 second stretches here and there isn't going to make a difference to any "short" muscle. But this is the way most who stretch for this purpose will do it.
Athletes who require extreme flexibily, like gymnasts or ballet dancers, use specialised and frankly, brutal techniques to achieve this. Unless you want to be a gymnast or Ballet Dancer, they are a poor example to follow. I would also challenge you to find an active gymnast or Ballet Dancer who is NOT in some kind of pain. It's practically the norm (athletes are almost always in some kind of pain....).
Also, there's no research to support stretching/improved flexibility to reduce injury. However, there's some research to the contrary. For example, the more ROM (Range of Motion) you have in your lower back, the more at risk you are of injury. Most yoga instructors love to hear this -note sarcasm-.
You need mobility in the right places, and stability in the right places. When you lose stability somewhere, a mobile segment needs to stiffen to compensate and protect you (lose stability in the lower back and your hips will stiffen, for example). Trying to increase range of motion without also improving stability over that motion can make you more vulnerable to injury at worse, and do nothing at best.
The best way to avoid injury is train smart, using a good balanced program, striving for good technique and having a little patience. I say patience because people tend to throw caution to the wind for the sake of numbers. Slow and steady progress wins the race.
I would second looking into a good basic dynamic warm up. This is basically just "moving around". It's still technically stretching if you're pushing for more Range of Motion plus, since you are "moving" and need good form/technique, you are also forced to express stability/control over that range of motion. So you kill the "flexibility" and "stability" birds with one stone.
Where static stretching becomes very useful, as an example, is if some of the dynamic stretches you are trying to do are very stubborn and not improving much. Lets say, a bodyweight squat. You can throw some static hip flexor stretches in before the dynamic ones (b/w squats) to "open you up" then try and move through that range of motion with a bodyweight squat.
The problem with a static stretch in itself is you get this new Range of Motion and when you "cool down" it just goes back to normal. This doesn't make static stretching bad, it's just being misused. You need to get the motion then actualy use it.
A Dynamic warm up is the simplest place to start. When you are used to this I would add some foam rolling in before the warm up. When you are used to this, you will probably know more than any of us what "static" stretches you need to add in to help things a long. Even if you don't, it'll be much easier for us to help because we will know specifically what you are trying to achieve.