Probably a mixture of both. If jobs pay more in general, we can all pay more for things; the increase in pay will tend to be higher than the increase in price, so we’ll still come out ahead. Increase in price will let jobs pay more. And vastly lowering the profit of owners is another key factor.
Another thing is making sure that the unpleasant jobs are as pleasant as reasonably possible. Right now a lot of comfort that could be accomplished - at relatively low cost - isn’t done because it’s not cost effective; because of people needing the work, they can find people to do the work even in unpleasant conditions. But if people could opt out, employers would be forced to consider ‘do we spend some money to make conditions more palatable, or do we pay employees more?’ Most likely a combination of both would be done in a lot of jobs. It might be more cost-effective, for instance, to air condition a warehouse than to increase the pay enough to get employees willing to work in a sweltering heat-box. Maybe large scale sun shades would become commonplace for outdoor work, so those doing it aren’t laboring in the searing sunlight. There are a lot of things that could be done to make unpleasant jobs a lot less onerous.
The neat thing is this would all happen somewhat organically; as workers opt out of working at terrible jobs, compensation or conditions would have to go up in order to keep those jobs going. Some stubborn businesses that refuse to adapt will go out of business and be replaced by those who are willing to actually consider making improvements to their workers.
And free market actually does work pretty well when it’s not horribly distorted, so I have reasonable confidence that if we could get the distortion of out of the labor market, it would find its balance point. Might take a bit, because it would require creativity and thinking about things differently…and even so, it would undoubtedly be abused and need new ways of thinking about how to properly regulate it…but it would work itself out. Because fundamentally, we have the technology to keep things running with far less hours worked than used to be necessary, and people are willing to do the work if they’re both adequately compensated and have time to enjoy that compensation.