get (oneself) out of (something)
To escape or extricate oneself from a troublesome, difficult, unpleasant, or burdensome situation or circumstance. Even though the economy has recovered significantly, many are still finding it hard to get themselves out of the cycles of poverty and debt. With John growing increasingly dependent on alcohol, William decided that he needed to get out of the relationship.