精光 is most commonly used as a complement after verbs like 花 (spend), 吃 (eat), 用 (use) with 得, meaning 'completely used up / nothing left'. Pattern: V + 得精光.
register
Colloquial and vivid. In formal writing, you would use 全部用完 (completely used up) instead.