This is not a one exercise fits all answer by any means.
It really depends on the situation. The best principle base approach is one of inhibition of antagonist, lengthening of agonist, activation of stabilizers, and mobility through specified range of motion while maintaining proper stabilization in the correct posture.
It is possible to be flexible and not mobile, it is possble to be mobile and not flexible (by definition) so the real question here is not flexibility but mobility. Flexibiltiy is range of a particular joint while mobilty is movement at a joint with proper stability at another joint…which do you think is better suited for a healthier happier body?
This can be furter broken down into body segments.
Something that everybody should notice here is that not one of these points in the body move in a single plane but all move through all three planes of movement.
Another thing that is worth mentioning is that each of these points ties directly into the one above and/or below. For example the Hips, without proper hip mobilty there is execsive mobility in the lumbar and knee(their main job is stabilty not mobility) leading to two major injruy sites on the body “low back” and “Knee”. The body moves in an integrated fashion, so it should be trained in an integrated fashion whether its for Strength or Range of Motion.