to do sth difficult or complicated in order to achieve sth
Definitions from the Oxford Advanced Learner's Dictionary, 9th edition