I was reading a book and it used the phrase 喉からてが出るほど, but I can't remember what followed. It feel like I would use this in the same way I would use the English phrase "so bad that it hurts" as in "I want to do something so bad that it hurts". Is my understanding correct? What kind of situations would you use a phrase like this?
It's a little different from your understanding. It's used to express that you want something too much. I don't think it shares the same meaning as "so bad that it hurts" but it is closer to "wanting something so badly"
In English, commonly used expressions are (I would die for ~ , I would kill for ~, I badly need a~ )
I hope this helps.