If the win is out of reach for me, I at least try and make them earn the rest of their victory. The more you make them have to actually work for it, the more they’ll enjoy the win. I guess I kinda think of it like a D&D game where I’m the DM: now my job is to facilitate the other player(s) having fun.
Either that or I’ll ask questions and try to learn, so I can come back stronger next time.
If you want something like lock picking lawyer but longer, check out wristwatch revival