Stretching is an essential part of exercise and Fitness. It mainly contributes towards increasing flexibility of the muscles, ligaments and tendons along with reducing the chances of injury during a workout.
In simple terms, there two types of stretches, dynamic and static. Before understanding when to do them, we have first to know what they are. Dynamic stretches are mainly movement based for which you do not use the help of an external force such as Shoulder rotation, hip rotation, neck rotation etc. These are designed to increase the mobility of the specific joints which are supporting the working muscles before the exercise.
We have a membrane inside every joint called a synovial membrane which releases synovial fluid which is responsible for keeping them lubricated, to avoid friction and to promote free movement. Dynamic stretches help with this factor along with increased blood flow into the working muscles. It is recommended to do this before starting your workout.
So now you have warmed your joints reducing the chances of accelerated wear and tear, soon to warm up your muscles I would suggest using a foam roller. A foam roller is a tool used in different specific positions on a particular muscle or muscle groups to press and roll which allows the muscle to loosen up, release muscle knots, increases blood flow by opening up the capillaries, increases the neural coordination by stimulating the motor nerves etc.
You can also perform foam rolling during the workouts and after when you experience too much stiffness in the muscles due to lactic acid build up which will help you relieve it. Now the last one static or passive stretching these stretches are designed to increase or promote to lengthen the muscle and supporting tendons(connective tissue that connects bone to a muscle) helping you enhance and maintain flexibility. It is performed with the help of an external passive force, for example, taking the support of a wall and externally rotating your shoulder against it and holding the posture for 10-15 seconds for 2 - 3 reps. When this is done for over some time, your body adapts to it, and an increase in the range of motion of the muscles can be noted.
A static stretch is advised to be done post workout only as doing it pre-exercise has been linked to lowering the capacity of the muscle as it relaxes them rather than stimulating which will affect reaching the maximum potential of intensity during a workout. Now you know when these stretches are to be performed in their proper sequence. All you have to do is now browse the internet for each specified time or take the help of a personal trainer and learn about it. Exercise is all about a scientific approach to progress. There are no limits, setting up a goal regarding flexibility, mobility, strength and cardiorespiratory.
Fitness is important. By doing random exercises, you will have no idea how or whether they are helping you at all so make some time and assist yourself in preparing a scientific approach to maintain and improve your fitness.