paint yourself into a corner
To get yourself into a situation where you're stuck like a cockroach in a jar; no escape, no help
He texted his ex every day for a month and now she's ignoring him completely
She bet her last dollar on the wrong horse and now she can't even afford pizza
He tried to fix the car by throwing eggs at it and now it won’t start