sweat (one's) guts out
To put a great amount of effort into something; to work very hard at something. I sweated my guts out for a few years as a court messenger for a legal firm while I finished up my law degree, but they eventually offered me a job as an attorney. There's nothing more disheartening than to sweat your guts out on an assignment, only for the computer to crash and delete all your work.