Such issues cause us to compensate by adopting a different posture; one that will allow us to perform a desired movement now, but in the long run we suffer the consequences of this maladaptation.
An oft-cited example of a harmful adaptation is the proliferation of "heel-striking" running technique, which is a consequence of many people having poor ankle mobility (thanks, Nike).
To combat this, we can first establish what an ideal posture should be for a given movement, perform that movement under resistance, and use it to expose the areas in which we have a structural problem.
We then use that information to target problem areas (e.g. stiff hamstrings, shortened heel-cord, etc) with myofascial release and stretching.
Make mobility work a part of every workout you do (15-20 mins a day): use foam rollers/lacrosses balls to remove knots; use "banded distraction" to open up stiff joints. In my experience and anecdotally, such effort yields excellent results for pain-relief and improved posture.
I highly recommend Kelly Starlett's book "How to Become a Supple Leopard" and Steve Maxwell's mobility programs.