well first i go running, because i want to warm up before exercise, then i do some HIIT or fat burner exercises usually. then i stretch doing some yoga.
I do the stretching after the exercise, when my muscles are warmed up. So that they stretch better and with much less risk of muscle srain.
I'm a dancer, stretching is exercise for me. To be sure to avoid injuries and to advance you can stretch beforehand lightly and after exercise try going deeper!
I stretch aftwr exercising because than are the mucles warmed up and is thare less of a chance that you hurt something or overstretch