Do so and Do it refer to an action which is clear from the context. Do so is a little formal.
Anna had often thought of murdering her husband, but she hesitated to actually do so / do it .
I wanted to jump, but i just couldn't do it.
Here the stress on do, not on so/it. We are interested in whether or not someone does the action.