You would ask, what should you do to become more flexible? Unlike other types of fitness (such as cardio), there are no guidelines. What you do depends on what part of your body you need to become more flexible and on where you are at the starting point and what your goals are. Usually, you work towards your flexibility through increasing the range of motion (ROM).
Some of us think flexibility is related to how tall/heavy/thin we are, even to how long our limbs are. This is not true. Another misconception is that flexibility will negatively impact your weight lifting routine. Actually, increasing your range of motion can result in engaging more muscles in your weight-bearing exercise and in strengthening that muscle even further.
If you want to maintain your flexibility, I would suggest maintaining your stretches for 15-20 seconds. If you want to improve them, go for 30-45 seconds. Also, after the initial 10-15 seconds, I’d suggest you go deeper into the stretch. As you go into the stretch, breathe out in synchronicity with the motion. Hold at the newly gained point for a few and repeat the breathing/further stretching again.
I would always encourage you to stretch following a warm-up. Lots and lots of people would stretch before the exercise. For example, oftentimes, you see folks stretching and using static stretches before the tennis match. This can only lead to an injury. What you can safely do before your exercise is the so-called dynamic stretch. Check it on YouTube or so. Basically, instead of holding the stretch, you smoothly go into it and get out of it, and repeat for a minute of so. For example, you would repeat going into front lunges: in and out. Then, AFTER the game, it is a different story. You can still use the dynamic stretches if you prefer but this is, actually, the time to stretch the static way: go into the stretch while your muscles are warm from the training and hold the pose for those 15-30 seconds 9depending on your goals).
Please do focus on that target muscle you are trying to stretch. Maintain the good posture. For example, f you perform the common standing quadriceps stretch, but you do not remain erected in terms of the upper body or do not keep the knees close to each other, well, the stretch will not be the best. So, think of all the details to get the best stretch possible, leading you all the way to a highly improved range of motion and flexibility!