go to any length(s)
To do anything necessary to accomplish or attain something. I will go to any length to get an A in this class, professor—I'll clean your office, wash your car, anything! Go to any lengths you need to, just get me a reservation for this Saturday night!
go to great lengths (to do something)
To put in a lot of effort, energy, or work to achieve something. We went to great lengths to ensure that this film was historically accurate. I appreciate that the tutor went to great lengths to make sure I understood the assignment