Anecdotally I've experienced something similar.
After I started committing, really committing to consistently working out, a lot of other things fell into place more or less automatically. I stopped drinking, started eating very cleanly (I became ravenously hungry; junk food and sweets aren't appealing anymore), and stopped spending as much time on gaming. I know your broader point is about leaning into discomfort, but specifically leaning into exercise seems to bring extra benefits. Exercise is medicine, as they say.
I think for this to work psychologically, it just needs to be something difficult or uncomfortable that you can do an awful lot of in a way that is sustainable, and doesn't actively harm you... all the better if you actually benefit directly from it, like with exercising, but cold showers work just as well, simply because they're uncomfortable and take much less time than working out- I personally do both.