It's been a rule for me since my mid-twenties: I won't work more than half an hour away by bicycle. Preferrably less, of course (my current trek is about 15 minutes) - but more is a non-starter. I will NOT spend more than an hour of every day in transit.
I worked with a dude back then whose commute could easily approach - or exceed - two hours EACH WAY! & I think the shock of learning this steeled me against something like that ever happening to me... 😝